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

Annotating a tag in Git goes beyond simple marking and provides you with the opportunity to add context and valuable information to your important milestones, releases, or versions. Annotated tags serve as permanent references to specific points in your commit history, supplemented with additional details such as author information, release notes, or relevant commit messages.

In this part of our tutorial, we will explore the process of annotating a tag in Git. By incorporating annotated tags into your Git workflow, you'll be able to communicate important information, provide valuable insights to future collaborators, and better document the evolution of your codebase.

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