What is a Tag
A tag is a ref that marks a specific commit and does not move. Unlike branches, which advance with each new commit, tags stay fixed at the commit where they were created.
How it works
Lightweight tags are plain refs — a file in .git/refs/tags/ containing a commit hash. git tag v1.0 creates one. They are identical to branches except they never move.
Annotated tags create a tag object in the Git object database containing the tagger name, email, date, a message, and a pointer to the target commit. git tag -a v1.0 -m "Release 1.0" creates one. Annotated tags are GPG-signable and are the recommended form for releases.
git tag v1.0 # lightweight
git tag -a v1.0 -m "msg" # annotated
git push origin v1.0 # tags must be pushed explicitly
Tags are not pushed by default — git push only pushes branches. You must explicitly push tags with git push --tags or git push origin <tagname>.
Why it matters
Tags mark release points in history. They give you a permanent, human-readable name for a specific commit. Since tags do not move, v1.0 always refers to the same commit, making them reliable for builds, deployments, and changelogs.
See How Git Branching Works for how tags compare to branches.