Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove or edit an unpushed Git tag [duplicate]

Tags:

git

git-tag

In our company we use Git tags to trigger production builds. I just created a tag locally with

git tag -m "Tag message"

but realize I've made a typo mistake, which will mess up with the production build if I share the tag (push it to remote).

Can I remove or amend the tag as I would be able to do with commits? I haven't pushed the tag to the remote repository yet.

like image 840
Wallace Sidhrée Avatar asked May 28 '14 09:05

Wallace Sidhrée


1 Answers

Delete a local tag with

git tag -d tag_name

Delete a remote tag with

git push origin :refs/tags/tag_name

However, the command git tag -m "Tag message" wont work as you aren't supplying a tag name. You may find that you haven't actually created a tag yet

You can list all your tags with

git tag --list
like image 98
Xetius Avatar answered Nov 01 '22 17:11

Xetius