Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2017 Update 2 - Cannot Edit/Delete Git Tag

Tags:

git

git-tag

tfs

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?

like image 509
dey.shin Avatar asked Aug 21 '17 15:08

dey.shin


People also ask

How do you delete a tag in TFS?

To delete a tag, select the ellipsis to the right of the tag name and choose Delete tag.

Can you delete a git 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.

Can you modify a git tag?

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.


1 Answers

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

enter image description here

like image 188
Andy Li-MSFT Avatar answered Nov 10 '22 01:11

Andy Li-MSFT