Git 中的tag指向一次commit的id,通常用来给开发分支做一个标记,如标记一个版本号。

git tag  查看所有的tag

git tag -a v1.01 -m "Relase version 1.01"

过滤查看

git tag -l

       -l <pattern>, --list <pattern>
           List tags with names that match the given pattern (or all if no pattern is given). Running
           "git tag" without arguments also lists all tags. The pattern is a shell wildcard (i.e.,
           matched using fnmatch(3)). Multiple patterns may be given; if any of them matches, the tag
           is shown.



 -a, --annotate
           Make an unsigned, annotated tag object

    -m <msg>, --message=<msg>
           Use the given tag message (instead of prompting). If multiple -m options are given, their
           values are concatenated as separate paragraphs. Implies -a if none of -a, -s, or -u <keyid>
           is given.

-a 是添加标签,其后要跟新标签号,-m 及后面的字符串是对该标签的注释。


git tag -d v1.01
注解:-d 表示删除,后面跟要删除的tag名字