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.](/static/7e388995b20475ac8a636eb5d35826fa/5a190/01.png)