Tagging Releases
Tags mark specific points in history, typically for releases.
Types of Tags
| Type | Description | Command |
|---|---|---|
| Lightweight | Just a pointer | git tag v1.0 |
| Annotated | Full object with metadata | git tag -a v1.0 |
Creating Tags
Tag Commands
| Command | Description |
|---|---|
git tag | List all tags |
git tag <name> | Create lightweight tag |
git tag -a <name> | Create annotated tag |
git tag -d <name> | Delete local tag |
git push --tags | Push tags to remote |
Lightweight Tags
Simple pointer to a commit:
git tag v1.0.0
Annotated Tags (Recommended)
Include tagger, date, message, and can be signed:
git tag -a v1.0.0 -m "Release version 1.0.0"
Tagging Past Commits
git tag -a v0.9.0 abc1234 -m "Beta release"
Viewing Tags
List All Tags
git tag
git tag -l "v1.*" # Filter with pattern
Show Tag Details
git show v1.0.0
Pushing Tags
Tags are not pushed by default:
# Push specific tag
git push origin v1.0.0
# Push all tags
git push --tags
Deleting Tags
Local Tag
git tag -d v1.0.0
Remote Tag
git push origin --delete v1.0.0
Checking Out Tags
git checkout v1.0.0
This creates a detached HEAD. To make changes:
git checkout -b hotfix-v1.0.1 v1.0.0
Semantic Versioning
Common tag format: vMAJOR.MINOR.PATCH
- MAJOR: Breaking changes
- MINOR: New features (backwards compatible)
- PATCH: Bug fixes
Examples: v1.0.0, v2.1.3, v0.9.0-beta
Exercise: Create a Tag
Create a tag for version 1.0:

