Git Tag
// Definition
A named, fixed pointer to a specific commit — used to mark release points like `v2.4.0`. Unlike a branch, a tag doesn't move; it permanently marks "this exact commit is release 2.4.0". Annotated tags also carry a message and author, which is what release tooling reads.
// Why it matters
Tags are how QA pins exactly which commit a release (and its test run) corresponds to — "the bug is in v2.4.0" maps to one immovable commit. They're also what CI/CD pipelines trigger on for release builds, so understanding tags is part of understanding what got tested and shipped.
// How to test
git tag -a v2.4.0 -m "Release 2.4.0" # annotated tag on the current commit git push origin v2.4.0 # often triggers a release pipeline git checkout v2.4.0 # check out the exact shipped code to test it
// Common mistakes
- Confusing a tag (fixed pointer) with a branch (moving pointer)
- Lightweight tags where annotated were needed (release tooling wants the metadata)
- Re-tagging/moving a tag others have pulled (breaks their reference to the release)
// Related terms
Commit
A saved snapshot of changes in a Git repo, with a message describing what changed and a unique hash identifying it. Commits are the atomic unit of history — each one is a revertible, reviewable point you can return to. Good commits are small and focused; the message explains why, not just what.
Branch
An independent line of development in a Git repository — a movable pointer to a commit, letting you work on a feature or fix in isolation without touching the main line. Branches are cheap and disposable; the typical flow is branch off `main`, commit work, open a pull request, merge back.