Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 307
Dlongnecker Avatar asked Jul 23 '13 15:07

Dlongnecker


People also ask

How do I annotate a tag in git?

In order to create a Git tag for the last commit of your current checked out branch, use the “git tag” command with the tag name and specify “HEAD” as the commit to create the tag from. Similarly, if you want your tag to be annotated, you can still use the “-a” and “-m” options to annotate your tag.

Can git tags have letters?

The following are the rules for a tag: Each tag must be unique; two separate commits cannot have the same tag. Tags can be any combination of letters and numbers (but not spaces) see § 2.6.

How will you list your tags in git?

Listing the available tags in Git is straightforward. Just type git tag (with optional -l or --list ). You can also search for tags that match a particular pattern. The command finds the most recent tag that is reachable from a commit.


1 Answers

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.

like image 182
andyg0808 Avatar answered Nov 13 '22 02:11

andyg0808