Git Action Tags

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.