Tagging Releases
When you ship a version, you want a permanent, memorable marker for that exact commit. Tags do precisely that. By the end of this lesson you'll create lightweight and annotated tags, push them, delete them, and version your releases with semantic versioning.
Learn Tagging Releases in our free Git course — a beginner-friendly interactive lesson with worked examples, a practice exercise and a quick reference.
Part of the free Git course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.
1️⃣ Lightweight vs Annotated Tags
A tag is a fixed name for one commit; it doesn't move when you commit again. A lightweight tag ( git tag v1.0.0 ) is just that name. An annotated tag ( git tag -a v1.1.0 -m "..." ) is a full object storing who tagged it, when, and why — the recommended choice for real releases, and the only kind that can be signed.
2️⃣ Listing & Inspecting Tags
git tag lists every tag, and git tag -l "v1.*" filters by pattern. git show <tag> reveals what it points to — for an annotated tag you also see the tagger, date, and message; a lightweight tag just shows its commit.
3️⃣ Pushing & Deleting Tags
Here's the catch that surprises everyone: a normal git push does not send tags . Push one with git push origin v1.1.0 , or all of them with git push --tags . Delete a tag locally with git tag -d , and remove it from the remote with git push origin --delete .
4️⃣ Semantic Versioning
Tags are most useful when their names mean something. Semantic versioning uses MAJOR.MINOR.PATCH : bump MAJOR for breaking changes, MINOR for new backward-compatible features, and PATCH for backward-compatible bug fixes. A glance at v2.3.1 tells users how risky an upgrade is.
Your turn. Cut an annotated release tag and publish it. Fill in the three blanks.
📋 Quick Reference
No commands given this time — just the plan. Walk a tiny project through four releases using correct semver tags.
Practice quiz
What is a Git tag?
- A movable branch label
- A commit message
- A fixed, named pointer to a specific commit
- A remote URL
Answer: A fixed, named pointer to a specific commit. A tag marks one specific commit with a memorable name, typically for releases.
How does a tag differ from a branch?
- A branch moves forward as you commit; a tag stays pinned to one commit
- Tags move with new commits; branches don't
- They are identical
- Tags can't be pushed
Answer: A branch moves forward as you commit; a tag stays pinned to one commit. Branches advance with each commit, while a tag stays fixed on the commit it marks.
Which command creates a LIGHTWEIGHT tag?
- git tag -a v1.0.0
- git tag --light v1.0.0
- git branch v1.0.0
- git tag v1.0.0
Answer: git tag v1.0.0. git tag <name> with no -a creates a lightweight tag — just a name pointing at a commit.
Which creates an ANNOTATED tag?
- git tag v1.0.0
- git tag -a v1.0.0 -m "message"
- git tag --quick v1.0.0
- git commit --tag
Answer: git tag -a v1.0.0 -m "message". git tag -a creates an annotated tag, a full object with tagger, date, and message.
What extra information does an annotated tag store?
- Tagger name, date, and a message
- Nothing extra
- The whole repo
- A branch list
Answer: Tagger name, date, and a message. Annotated tags are real objects holding the tagger, a timestamp, and a message.
Why are annotated tags recommended for releases?
- They're smaller
- They move automatically
- They carry metadata (who/when/why) and can be signed
- They skip the staging area
Answer: They carry metadata (who/when/why) and can be signed. Annotated tags record who tagged, when, and why, which matters for real releases.
By default, does send your tags to the remote?
- Yes, automatically
- No — tags must be pushed explicitly
- Only annotated tags
- Only on the first push
Answer: No — tags must be pushed explicitly. Tags aren't pushed by default; use git push origin <tag> or git push --tags.
Which command pushes ALL your local tags?
- git push
- git tag --push
- git send-tags
- git push --tags
Answer: git push --tags. git push --tags uploads every local tag to the remote.
In semantic versioning v2.3.1, the '3' is the...
- MAJOR version
- MINOR version
- PATCH version
- Build number
Answer: MINOR version. In MAJOR.MINOR.PATCH, the middle number is the MINOR version, bumped for backward-compatible features.
Which command deletes a local tag?
- git tag -r v1.0.0
- git untag v1.0.0
- git tag -d v1.0.0
- git rm v1.0.0
Answer: git tag -d v1.0.0. git tag -d <name> deletes a tag locally.