Git Annotated Tags Explained — Marking Releases in Git
In the previous blog, we learned how to create lightweight tags.
Now let’s look at their big brother — annotated tags.
You’ll understand:
- What annotated tags are
- How they differ from lightweight tags
- How to create them
- How they’re used for releases on GitHub
What Are Annotated Tags?
Lightweight tags are simple pointers to a commit.
Annotated tags, on the other hand, store extra metadata, including:
- Tagger name
- Date of creation
- Tag message
👉 In real life, annotated tags are most often used for version releases.
Think of them like this:
- Lightweight tag = A sticky note on a page.
- Annotated tag = A sticky note with details written on it (who added it, when, why).
Creating an Annotated Tag
To create an annotated tag, use -a with a message:
git tag -a v10.0 -m "MVP release"
Viewing Tags
List all tags:
git tag
View details of a tag:
git show v0.1
👉 For lightweight tags, you’ll only see the commit details.
git show v10.0
👉 For annotated tags, you’ll see extra details:
tag v10.0
Tagger: Gaurav Sharma <email@example.com>
Date: Sat Sep 6 10:00 2025 +0530
MVP release
commit a1b2c3d
Author: Gaurav Sharma <email@example.com>
Date: Sat Sep 6 09:30 2025 +0530
Added product.txt
✅ Annotated tags preserve who, when, and why the tag was created.
Pushing Tags to GitHub
By default, tags don’t get pushed. To push a specific tag:
git push origin v10.0
Push all tags:
git push origin --tags
👉 After pushing, you can see them under Releases → Tags in GitHub.
Using Tags for Releases on GitHub
Once tags are pushed, you can create a release in GitHub:
- Go to the Releases tab.
- Select the tag (lightweight or annotated).
- Add release notes, such as features added and bug fixes.
- Publish the release.
Now users can:
- See what’s included in the release.
- Directly download the source code at that tagged point.
Real-World Example
Projects use tags for every release:
- Tags:
v1.0.9,v1.1.0, etc. - Each release includes features, bug fixes, and downloadable source code.
This is the same practice you can follow for your own projects.
Visual Representation
Summary
- Lightweight tags → simple pointers to commits.
- Annotated tags → include metadata like author, date, and message.
- Use annotated tags for releases and versioning.
- Push tags with
git push origin <tag>or all withgit push origin --tags. - GitHub releases are usually tied to annotated tags.
Keep Learning 🚀
👉 Subscribe to Learning Ocean – Subscribers get coupon codes for my courses, early access to blogs and courses, and even exclusive YouTube videos.
👉 My YouTube Channel – More videos, more fun, and lots of learning!
👉 📺 Watch this topic in video form
Stay curious, keep coding, and let’s make learning fun together! 🎉