You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tag thats deleted in GitHub isn't deleted in GitHub Desktop after fetching #9946
I created a tag in a repository and then pulled that tag down to GitHub Desktop v2.5.2. The tag then shows on the commit in the repo history. I delete the tag from GitHub and then pull from remote to local in GitHub Desktop. The tag remains on the same commit in GH Desktop.
Hi @CraigMusser, thanks for opening this, sorry for the inconvenience!
Not deleting or updating local tags on fetch or pull is the intended behavior of Git. Conceptually a tag is an immutable object that is never supposed to change.
What should you do when you tag a wrong commit and you would want to re-tag?
If you never pushed anything out, just re-tag it. Use "-f" to replace the old one. And you’re done.
But if you have pushed things out (or others could just read your repository directly), then others will have already seen the old tag. In that case you can do one of two things:
The sane thing. Just admit you screwed up, and use a different name. Others have already seen one tag-name, and if you keep the same name, you may be in the situation that two people both have "version X", but they actually have different "X"'s. So just call it "X.1" and be done with it.
The insane thing. You really want to call the new version "X" too, even though others have already seen the old one. So just use git tag -f again, as if you hadn’t already published the old one.
However, Git does not (and it should not) change tags behind users back. So if somebody already got the old tag, doing a git pull on your tree shouldn’t just make them overwrite the old one.
If somebody got a release tag from you, you cannot just change the tag for them by updating your own one. This is a big security issue, in that people MUST be able to trust their tag-names. If you really want to do the insane thing, you need to just fess up to it, and tell people that you messed up. You can do that by making a very public announcement saying:
Ok, I messed up, and I pushed out an earlier version tagged as X. I
then fixed something, and retagged the *fixed* tree as X again.
If you got the wrong tag, and want the new one, please delete
the old one and fetch the new one by doing:
git tag -d X
git fetch origin tag X
to get my updated tag.
You can test which tag you have by doing
git rev-parse X
which should return 0123456789abcdef.. if you have the new version.
Sorry for the inconvenience.
Does this seem a bit complicated? It should be. There is no way that it would be correct to just "fix" it automatically. People need to know that their tags might have been changed.
If you're certain that you're the only one using the repository or that no one else has fetched your tag yet you can manually delete the tag locally by running git tag -d TAGNAME.
As this has to do with underlying conceptual semantics there's not much GitHub Desktop can do different here so I'm going to close this out.
Reacted by wilhei, Cyber Falcon, Anup D'Souza and Jeffrey Polasz
Activity
CraigMusser commentedon Jun 5, 2020
I created a tag in a repository and then pulled that tag down to GitHub Desktop v2.5.2. The tag then shows on the commit in the repo history. I delete the tag from GitHub and then pull from remote to local in GitHub Desktop. The tag remains on the same commit in GH Desktop.
niik commentedon Jun 5, 2020
Hi @CraigMusser, thanks for opening this, sorry for the inconvenience!
Not deleting or updating local tags on fetch or pull is the intended behavior of Git. Conceptually a tag is an immutable object that is never supposed to change.
The
git tagman page has a great section on this if you're curious.If you're certain that you're the only one using the repository or that no one else has fetched your tag yet you can manually delete the tag locally by running
git tag -d TAGNAME.As this has to do with underlying conceptual semantics there's not much GitHub Desktop can do different here so I'm going to close this out.