Figen Güngör Figen Güngör - 1 month ago 6
Git Question

Git tags are displayed but I can't delete one of them

There it is:

enter image description here

I'm displaying my tags with

git tag


However can't delete one of them which is the last tag in my repo and I want to recreate it with latest commits.

It says:

error: tag ... not found.

I see it's there in the list but not found when I try to delete it. What might I be doing wrong?

Answer

Check if the single quotes are needed here:

git tag -d -- Retrofit2_Hatakontrolu

Note the use of the double hyphen syntax '--' in order to separate the command from its parameters.

Also, check for the presence of special characters in the tag name, in a Linux (Git) bash.

export LESS="-CQaix4r"
git tag|less

In the off-chance the single quotes are part of the tag name, try:

git tag -d -- 'Retrofit2_Hatakontrolu'
# or (escaping single quotes):
git tag -d -- \'Retrofit2_Hatakontrolu\'
Comments