Tagging Milestones and Software Releases with git tag0%

Tagging Milestones and Software Releases with git tag

Beginner12 min read•Updated: Jul 11, 2026
Study MaterialsCheatsheet

Tagging Milestones and Software Releases with git tag

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.

Output
Branches Move:
(C1) ---> (C2) ---> (C3) [main advances...]
 
Tags Stay Fixed:
^
|
[v1.0.0] <--- Fixed permanent milestone!

2. The Two Types of Git Tags

Git supports two distinct types of tags:

AttributeLightweight TagAnnotated Tag (Recommended)
What is it?Just a simple bookmark pointer to a commit hashA full Git object stored in the database with checksum
MetadataNoneStores tagger name, email, timestamp, and release message
GPG SigningCannot be cryptographically signedCan be signed with GPG keys for verified releases
Use CaseQuick local private bookmarksOfficial software versions, production deployments

3. Creating and Managing Tags

A. Creating an Annotated Tag (-a)

Always use annotated tags for official releases:

Bash / Terminal
git tag -a v1.0.0 -m "Release version 1.0.0: Initial public launch with auth & payments"

B. Creating a Lightweight Tag

Bash / Terminal
git 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:

Bash / Terminal
git tag -a v0.9.0 4a2c91d -m "Release version 0.9.0 beta"

D. Listing All Tags

Bash / Terminal
git tag
 
# Filter tags by pattern
git tag -l "v1.*"

E. Viewing Tag Metadata (git show)

Bash / Terminal
git show v1.0.0

Output:

Output
tag v1.0.0
Tagger: Sumit Sharma <sumit@mskinstitute.com>
Date: Mon Sep 15 11:45:00 2026 +0530
 
Release version 1.0.0: Initial public launch with auth & payments
 
commit 7b3f81e28d4c5a9b0c2d4e6f8a0b1c2d3e4f5a6b
Author: Sumit Sharma <sumit@mskinstitute.com>
...

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:
Bash / Terminal
# Push a single specific tag
git push origin v1.0.0
 
# Or push ALL local tags at once
git push origin --tags

Releases on GitHub:

When you push tags like v1.0.0 to GitHub, GitHub automatically:

  1. 1
    Surfaces them under the Releases / Tags tab.
  2. 2
    Bundles the codebase into downloadable .zip and .tar.gz source code archives.
  3. 3
    Allows maintainers to attach compiled binaries, release notes, and changelogs.

Deleting a Tag:

Bash / Terminal
# Delete local tag
git tag -d v1.0.0
 
# Delete remote tag on GitHub
git push origin --delete v1.0.0

Interactive Quiz

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.

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

PrevNext