Cheat Sheets · Git Cheat Sheet · Git Tag a Release — Lightweight & Annotated Tags
Git Tag a Release — Lightweight & Annotated Tags
git tag -a v1.0.0 -m "Release v1.0.0"Annotated (Recommended)
git tag v1.0.0Lightweight
git push origin v1.0.0Push Single Tag
git push origin --tagsPush All Tags
Tag creation and push commands
| Command | Type | Description |
|---|---|---|
git tag -a v1.0.0 -m "Release v1.0.0" | Annotated (Recommended) | Includes tagger name, email, date, and message |
git tag v1.0.0 | Lightweight | Simple bookmark pointer to current commit (no metadata) |
git push origin v1.0.0 | Push Single Tag | Push specific tag to remote repository |
git push origin --tags | Push All Tags | Push all local tags to remote at once |
Tags point to specific points in Git history, typically marking release versions (e.g. v1.0.0, v2.1.3) in semantic versioning.
Related Git recipes
FAQ
Why prefer annotated tags over lightweight tags?
Annotated tags are full Git objects with cryptographic verification, author name, timestamp, and release notes. They are standard for releases.
Can I tag an older historical commit?
Yes: append the commit SHA: git tag -a v1.0.0 .
How to check out a tag?
Run git checkout v1.0.0 (puts you in detached HEAD) or git switch -c release-1.0 v1.0.0 to start a branch from the tag.
Stop memorizing — build it interactively
Build tag workflows in the Git BuilderFull reference: Git Cheat Sheet