CurriculumAdvanced GitTags & Releases
Lesson 6 of 6100%
Advanced6 min+60 XP

Tags & Releases

Tags mark specific commits as named milestones — almost always used for release versions. Unlike branches, tags never move when new commits are added. They are permanent, immutable markers in your project history.

01.Lightweight vs Annotated Tags

Lightweight tags are just a named pointer to a commit — like a branch that never moves. Annotated tags are stored as full Git objects and contain: the tagger's name and email, the date tagged, a tagging message, and optionally a GPG cryptographic signature. Always use annotated tags for releases — they carry rich metadata and can be signed for authenticity.

Commit Timeline
a1b2c3d
init
b2c3d4e
feat
c3d4e5f
fix
d4e5f6a
HEAD

02.Semantic Versioning (SemVer)

The standard convention for release tags: v{major}.{minor}.{patch}. Major: breaking API changes that require callers to update (v2.0.0). Minor: new features that are backward compatible (v1.3.0). Patch: bug fixes only (v1.3.1). Pre-releases: v2.0.0-beta.1, v2.0.0-rc.2. Following SemVer tells users instantly whether they can safely upgrade.

Branch Visualization
featuremainHEAD
main
feature
HEAD

Commands

commands — click to reveal output
$
git tag v1.0.0
Create a lightweight tag at the current commit
$
git tag -a v1.0.0 -m "First stable public release"
Create a rich annotated tag (use this for releases)
$
git tag -a v1.0.0 a3f8c21 -m "Release"
Tag a specific past commit by its hash
$
git tag
List all tags in alphabetical order
▼ show output
$
git show v1.0.0
View full tag metadata and the tagged commit details
$
git push origin v1.0.0
Push a single specific tag to remote
$
git push origin --tags
Push ALL local tags to the remote at once
$
git tag -d v1.0.0
Delete a tag locally
$
git push origin --delete v1.0.0
Delete a tag from the remote repository
KNOWLEDGE CHECK

How is a tag different from a branch?

Rate this lesson:
PreviousNext Lesson