Skip to main content

What is an annotated tag?

An annotated tag is a full-fledged Git tag that is stored as a separate object and contains metadata about a version or release.

In simpler terms: an annotated tag is a "signed label" with a description and an author.


What an annotated tag contains

An annotated tag includes:

  • the tag name (v1.2.0)
  • a message (release description)
  • the author's name
  • the creation date
  • (optionally) a GPG signature

That is exactly why annotated tags are recommended for releases.


How to create an annotated tag

bash
git tag -a v1.2.0 -m "Release version 1.2.0"

If you don't specify -m, Git opens an editor for the message.


How it differs from a lightweight tag

Annotated tagLightweight tag
A separate Git objectJust a reference
Has a messageHas no message
Has an author and dateHas no metadata
Can be signedCannot be signed
Used for releasesFor local markers

Why an annotated tag matters for CI/CD

  • easy to see who created the tag and why
  • convenient for automating releases
  • CI/CD is often triggered only on annotated tags
  • the tag's signature can be verified

How to view information about a tag

bash
git show v1.2.0

Shows:

  • information about the tag
  • the message
  • the commit it points to

Important point

An annotated tag is not a branch It does not move and is not intended for development


Short answer for an interview

An annotated tag is a Git tag that is a separate object and contains metadata (author, date, message). It is used to mark releases and versions.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.

What is an annotated tag?: Git Interview Question