2016/01/14 start learning git: Tag management: Creating tags

Source: Internet
Author: User
Tags version control system

Tag is also a snapshot of the repository
Pointer to a commit (the branch can be moved and the label cannot be moved)

Switch to the branch that needs to be labeled
git tag <name> can hit a new tag:

$ git Tag v1.0

git tag View all tags:

$ git tag
v1.0

The commit of the previous commit requires the commit ID
$ git tag v0.9 93ddf60

View Tag
$ git tag
v0.9
v1.0

Labels are not listed chronologically, but are sorted alphabetically. You can use Git show <tagname> to view tag information:
$ git show v0.9
Commit 93ddf602fefbc25e82045203d37b7add177aa17f
Author:lao_wan <[email protected]>
Date:thu Jan 14 00:55:11 2016 +0800

Test Dev

Diff--git A/123.txt B/123.txt
New File Mode 100644
Index 0000000..e69de29

[Email protected] Mingw64/e/learngit (Master)


Create a label with a description, specify the label name with-A,-m to specify the description text:
[Email protected] Mingw64/e/learngit (Master)
$git tag -A v0.1- m "version 0.1 released" 274dc89

[Email protected] Mingw64/e/learngit (Master)
$git show v0.1
Tag v0.1
Tagger:lao_wan <[email protected]>
Date:thu Jan 14 22:33:48 2016 +0800

Version 0.1 released

Commit 274dc892e7ff517c79c95661f29f6e19ff3e2524
Author:lao_wan <[email protected]>
Date:mon Jan 11 23:36:32 2016 +0800

Write a Readme.txt file

Diff--git A/readme.txt B/readme.txt
New File Mode 100644
Index 0000000..D8036C1
---/dev/null
+ + B/readme.txt
@@ -0,0 +1,2 @@
+git is a version control system.
+git is a free software.
\ No newline at end of file

[Email protected] Mingw64/e/learngit (Master)


Summary

command git tag <name> to create a new tag, the default is head, you can also specify a commit ID;
git tag-a <tagname>-M "Blablabla ..." to specify tag information;
git tag-s <tagname>-M "Blablabla ..." can be signed with PGP tag;
command git tag to view all tags.

2016/01/14 start learning git: Tag management: Creating 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.