1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. 如何使用 Git
  6. 如何在 Git 中使用標籤
  7. 為標籤加註解

Project and code management together.

Try it free


我們可以透過執行含有-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