为标签加注释
我们可以通过运行带有-a
选项的 git tag 命令来为标签 添加注释,这将打开默认的文本编辑器,让您添加注释。
如果您想在标签创建的同时添加注释,您也可以使用-am
选项。
运行以下命令,为 HEAD 添加一个名为tag2
的标签,并附上一些注释:
$ git tag -am "Simple Git tutorial for beginners" tag2
使用-n
选项将为您提供标签列表及其对该存储库的注释。
$ git tag -n
tag1 first commit
tag2 Simple Git tutorial for beginners
