Skip to main content
  1. Learn
  2. Software Development
  3. Guides
  4. Git tutorial
  5. How to use Git
  6. How to use tagging in Git
  7. Annotate a tag
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

Annotate a tag

We can add an annotation to a tag by running the git tag command with the -a option, which opens the default text editor that lets you add notes.

You can also use the -am option instead if you want to add the note alongside the tag creation.

Run the following command to add a tag for HEAD named tag2 with some notes:

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

Using the -n option will give you the list of tags with their notes for this repository.

$ 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