bashbeginner
Git Tag Management for Releases
Create, list, push, and manage annotated and lightweight tags for version releases.
bashPress ⌘/Ctrl + Shift + C to copy
# Create lightweight tag
git tag v1.0.0
# Create annotated tag (recommended for releases)
git tag -a v1.0.0 -m "Release version 1.0.0"
# Tag a specific commit
git tag -a v1.0.0 abc1234 -m "Release version 1.0.0"
# List all tags
git tag
# List tags matching a pattern
git tag -l "v1.*"
# Show tag details
git show v1.0.0
# Push a specific tag
git push origin v1.0.0
# Push all tags
git push origin --tags
# Delete local tag
git tag -d v1.0.0
# Delete remote tag
git push origin --delete v1.0.0
# Checkout a tag (detached HEAD)
git checkout v1.0.0
# Create branch from tag
git checkout -b hotfix/v1.0.1 v1.0.0
# Sort tags by version (semver)
git tag -l --sort=-v:refname "v*"
# Show latest tag
git describe --tags --abbrev=0
# Show distance from latest tag
git describe --tagsUse Cases
- Marking release points in project history
- Triggering CI/CD deployments from tags
- Managing semantic versioning workflow
Tags
Related Snippets
Similar patterns you can reuse in the same workflow.
bashintermediate
Git Tags — Signed Releases and Versioning
Create signed and annotated tags for releases with GPG verification and semantic versioning.
Best for: Creating verified release tags
#git#tags
bashintermediate
Git Hooks Pre Commit
Git workflow: git-hooks-pre-commit
Best for: version control
#git#version-control
bashadvanced
Git Hooks Post Commit
Git workflow: git-hooks-post-commit
Best for: version control
#git#version-control
bashadvanced
Git Lfs Large Files
Git workflow: git-lfs-large-files
Best for: version control
#git#version-control