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 tag | Lightweight tag |
|---|---|
| A separate Git object | Just a reference |
| Has a message | Has no message |
| Has an author and date | Has no metadata |
| Can be signed | Cannot be signed |
| Used for releases | For 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.0Shows:
- 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 readyPremium
A concise answer to help you respond confidently on this topic during an interview.