Skip to main content
  1. Learn
  2. Software Development
  3. Guides
  4. Git tutorial
  5. 如何使用 Git
  6. 如何在 Git 中使用标签
  7. 为标签加注释
GuidesSoftware DevelopmentBacklog

Project and code management together.


我们可以通过运行带有-a选项的 git tag 命令来为标签添加注释,这将打开默认的文本编辑器,让您添加注释。


运行以下命令,为 HEAD 添加一个名为tag2的标签,并附上一些注释:

$ git tag -am "Simple Git tutorial for beginners" tag2


$ git tag -n
  tag1           first commit
  tag2          Simple Git tutorial for beginners
Add a tag with an annotation "tag2" to a commit which HEAD is pointing out now.

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life