In software engineering, development moves continuously, but users and deployments interact with specific milestones: v1.0.0, v2.1.4-beta, etc. Git provides tags to mark specific points in repository history as important release milestones.
1. What is a Git Tag?
While a branch is a moving pointer that advances every time you make a commit, a tag is an immutable, permanent snapshot pointer. Once placed on a commit, a tag never moves.
1Branches Move:
2(C1) ---> (C2) ---> (C3) [main advances...]
3
4Tags Stay Fixed:
5 ^
6 |
7 [v1.0.0] <--- Fixed permanent milestone!
2. The Two Types of Git Tags
Git supports two distinct types of tags:
Attribute
Lightweight Tag
Annotated Tag (Recommended)
What is it?
Just a simple bookmark pointer to a commit hash
A full Git object stored in the database with checksum
Metadata
None
Stores tagger name, email, timestamp, and release message
GPG Signing
Cannot be cryptographically signed
Can be signed with GPG keys for verified releases
Use Case
Quick local private bookmarks
Official software versions, production deployments
3. Creating and Managing Tags
A. Creating an Annotated Tag (-a)
Always use annotated tags for official releases:
1git tag -a v1.0.0 -m"Release version 1.0.0: Initial public launch with auth & payments"
B. Creating a Lightweight Tag
1git tag v1.0.0-lw
C. Tagging a Past Commit
You don't have to be standing on a commit to tag it; just provide its hash:
1git tag -a v0.9.0 4a2c91d -m"Release version 0.9.0 beta"
D. Listing All Tags
1git tag
2
3# Filter tags by pattern
4git tag -l"v1.*"
E. Viewing Tag Metadata (git show)
1git show v1.0.0
Output:
1tag v1.0.0
2Tagger: Sumit Sharma <sumit@mskinstitute.com>
3Date: Mon Sep 15 11:45:00 2026 +0530
4
5Release version 1.0.0: Initial public launch with auth & payments
6
7commit 7b3f81e28d4c5a9b0c2d4e6f8a0b1c2d3e4f5a6b
8Author: Sumit Sharma <sumit@mskinstitute.com>
9...
4. Pushing Tags to GitHub
Important Warning
[!WARNING]
By default, running git push does NOT transfer tags to remote servers! You must explicitly push tags:
1# Push a single specific tag
2git push origin v1.0.0
3
4# Or push ALL local tags at once
5git push origin --tags
Releases on GitHub:
When you push tags like v1.0.0 to GitHub, GitHub automatically:
1
Surfaces them under the Releases / Tags tab.
2
Bundles the codebase into downloadable .zip and .tar.gz source code archives.
3
Allows maintainers to attach compiled binaries, release notes, and changelogs.
Deleting a Tag:
1# Delete local tag
2git tag -d v1.0.0
3
4# Delete remote tag on GitHub
5git push origin --delete v1.0.0
Interactive Quiz• Knowledge Check
Practice Quiz
Question 1
What is the fundamental difference between a Git branch and a Git tag?
Question 2
Why are Annotated Tags (git tag -a) preferred over Lightweight Tags for official releases?
Question 3
If you run git push origin main, are your newly created local tags automatically pushed to GitHub?
Question 4
How can you tag an older commit that occurred 3 days ago?
Question 5
What command deletes a remote tag named v1.2.0 from GitHub?
Next Lesson
Crafting a Professional README.md with Badges, Demos & Markdown
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.