Create an annotated tag for a release

Description: Mark the latest commit as version v1.0 with the message “First release”. Show all tags and the details of the tag.

Hint:

  • Use git tag -a with -m.

Solution

Terminal output

$ git tag -a v1.0 -m "First release"
$ git tag
v1.0
$ git show v1.0 –no-patch
tag v1.0
Tagger: Robin Sharma <robin@example.com>
Date: Sat Jan 10 10:49:00 2026 +0000

First release

commit 378ffde0b81bbd9da251867b0d52884f32d49425 (HEAD -> main, tag: v1.0)
Author: Robin Sharma <robin@example.com>
Date: Sat Jan 10 10:42:00 2026 +0000

Add app

How it works

  • An annotated tag stores the tagger, date and message.
  • Tags are not pushed by git push. Use git push origin v1.0.

Read Git Tag.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.