Dlongnecker
Dlongnecker

Reputation: 3047

Git tags with quote names on Windows

We've got a repo on GitHub with several tags with quotes " in the name. Occasionally, some Windows hosts will fail to fetch with the error below. I don't know why some Windows hosts fail to fetch and others don't, if we solved that that would be great.

fatal: Unable to create 'C:/src/code/tags/some_tag_"with_quotes".lock': Invalid argument

As a workaround, we deleted the tags on GitHub, but inevitably someone who has this tag locally runs a git push and pushes the tag back into GitHub. Having everyone reclone will be painful.

These tags cannot be deleted locally (on Windows), the same error is generated.

Upvotes: 8

Views: 1287

Answers (1)

andyg0808
andyg0808

Reputation: 1403

Note: This answer has been torn apart and rewritten from its original version

I wonder if you're having issues with the filesystem's permitted characters in filenames. For example, according to Wikipedia, FAT does not permit double-quotes ("). According to Wikipedia, NTFS will accept double-quotes only if a filename is in the Posix namespacem, but I cannot seem to find that information anywhere else. Further, Microsoft seems to recommend avoiding double-quotes in filenames. Posix appears to only allow A-Za-z_.- in "portable" filenames¹. See Wikipedia on filesystem limitations and filesystem capabilities for more.

Perhaps you might try the Cygwin version of Git. It appears that Cygwin manages to support quotes in filenames on Windows.

Upvotes: 2

Related Questions