git learning Notes --- Operating tag

If the label is wrong, you can also delete:

$ git tag -d v0.1
Deleted tag 'v0.1' (was f15b0dd) 

Because the label created only stored locally are not automatically pushed to the remote. Therefore, the wrong label can delete the local security.

If you want to push a label to the remote, use the command git push origin <tagname>:

$ git push origin v1.0
Total 0 (delta 0), reused 0 (delta 0) To github.com:michaelliao/learngit.git * [new tag] v1.0 -> v1.0 

Alternatively, a one-time push has not been pushed to all remote local label:

$ git push origin --tags
Total 0 (delta 0), reused 0 (delta 0) To github.com:michaelliao/learngit.git * [new tag] v0.9 -> v0.9 

If the tag has been pushed to the remote, remote tag you want to remove a little trouble, delete start local:

$ git tag -d v0.9
Deleted tag 'v0.9' (was f52c633) 

Then, remove from the remote. Delete command also push, but the format is as follows:

$ git push origin :refs/tags/v0.9
To github.com:michaelliao/learngit.git - [deleted] v0.9 

To see if it really is deleted from the remote tag library, you can log in to view GitHub.

 

summary

  • Command git push origin <tagname>can push a local label;

  • Command git push origin --tagscan not push off push all local label;

  • Command git tag -d <tagname>to delete a local label;

  • Command git push origin :refs/tags/<tagname>to delete a remote tag.

Guess you like

Origin www.cnblogs.com/saryli/p/11369222.html