How to use tag in git

Source: Internet
Author: User
Tags tag name


The tag in git points to the ID of a commit, which is typically used to mark the Development Branch , for example, to mark a version number for subsequent rollback.


One, tag: git tag-a v1.01-m "relase version 1.01"

Note: git tag is the label command,- A is the tag, followed by the new tag number ,-m and the following string is a comment on the label.


Second, submit tags to the remote warehouse: git push Origin--tags

Note: Just as GIT push Origin master submits local modifications to the remote repository,--tags can submit all local dozen labels to the remote repository.


Third, delete the label:
Git tag-d v1.01

Note:-D means delete, followed by the tag name to be deleted;


Four, delete the remote label
Git push origin:refs/tags/v1.01
Annotations: Just like git push origin:branch_1 can delete the branch branch_1 of a remote warehouse, the colon is empty before the deletion of the remote warehouse tag.


v. View tag git tag
Or

Git tag-l

=====================



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.