Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo tag that's not pushed in Git

I've made a commit and a tag (using git tag -a -m ). I found out before I pushed that I needed to revert the commit so I used git revert --soft HEAD~. How do I also remove the tag? I've checked with git push --tags --dry-run that it hasn't been pushed yet, so I hope it's possible to remove.

like image 478
user16655 Avatar asked Jun 02 '16 10:06

user16655


People also ask

How do I undo 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. To get a list of Git tag names, run git tag.

How do I remove a remote tag?

Select and expand the "Tags" tab on the left. Right-Click on the tag you want deleted. Select "Delete YOUR_TAG_NAME" In the verification window, select "Remove Tag From Remotes"


1 Answers

Just run the following command from the branch where you created the tag:

git tag -d <tag name>

Even if you pushed the tag already it is still possible to remove it. Check out this useful blog post.

like image 148
Tim Biegeleisen Avatar answered Oct 04 '22 09:10

Tim Biegeleisen