Unable to delete GIT tag due to special character "Ã"

A tag was created containing "Ã" in the name, I can’t delete the tag, I tried the following:

git tag -d -- xxÃxx git push origin :refs/tags/xxÃxx git config --global core.precomposeunicode true git tag -d -- xxÃxx git push origin :refs/tags/xxÃxx 

I also tried the double quote for the name.

When executing git commands, it is indicated that the tag has been removed: Local removal:

 Deleted tag 'xxÃxx' (was 434eae7) 

After clicking:

 remote: warning: Allowing deletion of corrupt ref. - [deleted] xxÃxx 

The "xxÃxx" tag appears as new on each git fetch -p or git tag (event after two consecutive clicks).

Also tried to remove the tag from the source tree, but the tag will reappear.

+5
source share
3 answers

To stop accepting the tag 'xxÃxx' as a new tag with each pull / fetch. I created a repository clone.

I did not find a solution on how to remove the tag, but this is acceptable to me.

Special thanks to @VonC.

+2
source

I'm probably too stubborn, but I wanted to find a solution that didn't include deleting the repo and cloning it again - and so it is.

My bad tag was ◊v2.2.29.

Adding the link to .git / packed-refs did the trick for me. Just duplicate (or add) a line in the packed refs file and change the tag to your problem one, in the format:

1ea677c29c1db49a284b3a0b44a5e96fda873da2 refs / tags / ◊v2.2.29

You do not need to know the identifier of the real object for this tag, but you need a valid number from your project. In my example, 1ea677c29c1db49a284b3a0b44a5e96fda873da2 is just the identifier of the object of another tag that I had (it doesn’t matter, of course, just select one from the other line in the same file), and the problem will be solved.

Side note: If you specify an identifier for an object that does not exist at all, git will either complain about it as invalid or just treat it as a new tag, depending on whether you got the structure correctly.

+1
source

In a similar case, I used the xargs combination of echo and xargs to remove the invalid tag containing the invalid Unicode character \u0083 :

 echo -e '\u0083release-1.7.5-hotfix1' |xargs git tag -d echo -e '\u0083release-1.7.5-hotfix1' |xargs push --delete origin 
0
source

All Articles