Create a Lightweight Tag
git tag <name> [commit]git tag v1.0.0
git tag v0.9.0 a1b2c3dNote Lightweight tags are just pointers to a commit — no extra metadata. For releases, prefer annotated tags which include author, date, and a message.
Git · 8 entries
git tag <name> [commit]git tag v1.0.0
git tag v0.9.0 a1b2c3dNote Lightweight tags are just pointers to a commit — no extra metadata. For releases, prefer annotated tags which include author, date, and a message.
git tag -a <name> -m "message" [commit]git tag -a v2.0.0 -m "Major release: new payment system"
git tag -a v1.5.0 -m "Performance improvements" a1b2c3dNote Annotated tags store the tagger's name, email, date, and a message. They're full Git objects. Use these for releases so you have a record of who tagged and why.
git tag [-l "pattern"]git tag
git tag -l "v2.*"v1.0.0
v1.5.0
v2.0.0
v2.1.0Note Use -l with a glob pattern to filter. Combine with --sort=-version:refname to sort by semantic version descending.
git push origin <tag>
git push origin --tags# Push a single tag:
git push origin v2.0.0
# Push all tags:
git push origin --tagsTo https://github.com/user/project.git
* [new tag] v2.0.0 -> v2.0.0Note Tags are NOT pushed automatically with git push. You must explicitly push them. --tags pushes all local tags that don't exist on the remote.
git tag -d <tag>
git push origin --delete <tag># Delete locally:
git tag -d v1.0.0-beta
# Delete from remote:
git push origin --delete v1.0.0-betaDeleted tag 'v1.0.0-beta' (was a1b2c3d)Note You must delete a tag both locally and on the remote — they're independent. Other collaborators who already fetched the tag will still have it until they prune.
git checkout <tag>git checkout v2.0.0Note: switching to 'v2.0.0'.
You are in 'detached HEAD' state.Note Checking out a tag puts you in detached HEAD state — you're not on any branch. To make changes, create a branch from the tag: git switch -c hotfix/v2.0.1
git show <tag>git show v2.0.0tag v2.0.0
Tagger: Samira Khan <samira@example.com>
Date: Mon Mar 30 14:22:01 2026 +0000
Major release: new payment system
commit a1b2c3d...
...Note For annotated tags, shows the tagger info and message plus the commit it points to. For lightweight tags, just shows the commit.
git describe --tags --abbrev=0
git describe --tagsgit describe --tags --abbrev=0
git describe --tagsv2.0.0
v2.0.0-3-ga1b2c3dNote --abbrev=0 gives just the tag name. Without it, Git also shows how many commits since that tag and the current abbreviated hash. Useful in CI/CD for version stamping.