Action Label
If the label is wrong, you can also delete it:
$ git tag -d v0.1Deleted tag ‘v0.1‘ (was e078af9)
Because the created labels are stored only locally, they are not automatically pushed to the remote. Therefore, the wrong tag can be safely deleted locally.
If you want to push a tag to a remote, use the command git push origin <tagname> :
$ git push origin v1.0Total 0 (delta 0), reused 0 (delta 0)To git@github.com:michaelliao/learngit.git * [new tag] v1.0 -> v1.0
Or, all-in-one push is not yet pushed to the remote local label:
1, done.Writing objects: 100% (1/1), 554 bytes, done.Total 1 (delta 0), reused 0 (delta 0)To git@github.com:michaelliao/learngit.git * [new tag] v0.2 -> v0.2 * [new tag] v0.9 -> v0.9
If the label has been pushed to the remote, to remove the remote label is a bit troublesome, first removed from the local:
$ git tag -d v0.9Deleted tag ‘v0.9‘ (was 6224937)
Then, remove from remote. The Delete command is also push, but the format is as follows:
$ git push origin :refs/tags/v0.9To git@github.com:michaelliao/learngit.git - [deleted] v0.9
To see if you really deleted the tag from the remote repository, you can check it out on GitHub.
Summary
Command git push origin <tagname> to push a local tag;
Command git push origin --tags to push all the local labels that have not been pushed;
Command git tag -d <tagname> to delete a local tag;
Command git push origin :refs/tags/<tagname> to delete a remote label.
Git Action Tags