Finally being able to use tagging function right from the TFS Portal after the TFS 2017 Update 2, I started adding Git Tags.
Noticing that some tags are missing Description (Tagging Message in Git), I tried to edit the tags; And I can't seem to find an option to edit/delete the tags.
Taking a hint from How do I edit an existing tag message in git?, I tried to overwrite the tags by creating tags with the same name.
TFS threw A Git ref with the name <tagName> already exists.
error.
I may be able to follow How to delete a git remote tag? using Git Bash from my Windows machine. I'm trying to find a way to accomplish this within the TFS portal though.
How can I edit/remove a Git Tag within the TFS 2017 Update 2 Portal?
To delete a tag, select the ellipsis to the right of the tag name and choose Delete tag.
Use Git to delete a Git tag To delete the Git tag from the local repo, run the git tag -d tag-name command where tag-name is the name of the Git tag you want to delete.
With Git 2.17 (Q2 2018), there will be an alternative to creating a new tag with git tag <tag name> <tag name> -f -m "<new message>" , since " git tag " learned an explicit " --edit " option that allows the message given via " -m " and " -F " to be further edited.
Currently, there isn't the feature to edit/remove a Git Tag via the web portal within TFS 2017 Update2. It's not supported. I have submitted a user voice here to suggest the feature, you can go and vote it up to achieve it in future.
As a workaround, just as you mentioned above, you can use Git Bash to overwrite the tags. I can reproduce the issue: "A Git ref with the name <tagName> already exists"
You have two ways to resolve that :
1. Do a force-push
eg: tag name is v1.4
git tag v1.4 v1.4 -f -m "Andy0822"
git push --force origin refs/tags/v1.4:refs/tags/v1.4
2. Delete the tag on the remote first, then push the updated tag.
git tag v1.4 v1.4 -f -m "Andy0822"
git push --delete origin v1.4
git push origin --tags
Please see this thread for more information: “tag already exists in the remote" error after recreating the git tag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With