Tagging Releases
git tag, lightweight tag, annotated tag, semantic versioning, pushing tags, deleting tags
Tagging Releases
Tags are references that point to specific commits and do not move as new commits are added. They are used to mark release points like v1.0.0 or v2.3.1, making it easy to check out a specific version at any time.
Lightweight Tags
A lightweight tag is just a name pointing to a commit — like a branch that never moves:
git tag v1.0.0Annotated Tags
Annotated tags store extra metadata: tagger name, email, date, and a message. They are recommended for releases because they are proper objects in the Git database:
git tag -a v1.0.0 -m "Release version 1.0.0"Semantic Versioning
Semantic versioning (semver) uses the format MAJOR.MINOR.PATCH. Increment MAJOR for breaking changes, MINOR for new backwards-compatible features, and PATCH for backwards-compatible bug fixes. Tags like v1.2.3 follow this standard.
Listing and Viewing Tags
git tag
git show v1.0.0Pushing Tags to Remote
Tags are not pushed automatically with git push. Push a specific tag or all tags:
git push origin v1.0.0
git push origin --tagsDeleting Tags
git tag -d v1.0.0-beta
git push origin --delete v1.0.0-beta