A Real Lightweight Tag
Nothing but a real, named pointer at a specific commit — structurally identical to a branch, except it is never meant to move.
A Real, Fully Annotated Tag
git tag -a v1.0.0 -m "Version 1.0.0 - first stable release"
This creates a genuine, separate tag object in the database — with its own real tagger, date, and message — which then points at the commit. git show v1.0.0 displays both layers: the tag's own real message, then the commit it points to.
The Real Difference, Confirmed Directly
cat .git/refs/tags/v0.9-beta # a plain commit hash
cat .git/refs/tags/v1.0.0 # a DIFFERENT hash — the real tag object, not the commit
A lightweight tag's ref file contains the commit's own hash directly. An annotated tag's ref file contains the hash of the real tag object instead — genuinely one more layer of indirection.
Sharing Real Tags
git push origin v0.9-beta v1.0.0
Tags are not included in a plain git push by default — they need to be pushed explicitly (or with --tags for all of them at once).
A tag marks one specific real commit as meaningful, permanently — a beta milestone, a release, a point worth coming back to by name instead of by hash. git supports two genuinely different kinds: a real lightweight tag, which is nothing more than a named pointer exactly like a branch (just one that never moves), and a real annotated tag, which is its own actual object in the database — with a tagger, a date, and a real message, the same way a commit has an author and a message.
v0.9-beta marks a real earlier milestone as a plain, lightweight pointer. v1.0.0, the real first stable release, gets the fully annotated treatment — because a release genuinely deserves a recorded reason, not just a name.
Lightweight tag
A real, named pointer directly at a commit — structurally the same as a branch, just one that is never meant to move. Confirmed directly in this lab: its ref file contains the commit's own hash.
Annotated tag
A genuine, separate object in git's database, with its own real tagger, date, and message, which then points at a commit. Confirmed directly in this lab: its ref file contains a different hash than the commit itself — the tag object's own hash.
Takeaways
- A lightweight tag is a plain, named pointer directly at a commit — like a branch that never moves
- An annotated tag is a real, separate object with its own tagger, date, and message, pointing at a commit
- git show and the ref file itself both reveal the real structural difference directly
- Tags are never included in a plain git push — they must be pushed explicitly