bashintermediate
Git Tags — Signed Releases and Versioning
Create signed and annotated tags for releases with GPG verification and semantic versioning.
bashPress ⌘/Ctrl + Shift + C to copy
# Create annotated tag (recommended for releases)
git tag -a v1.2.0 -m "Release 1.2.0: auth improvements"
# Create signed tag (requires GPG key)
git tag -s v1.2.0 -m "Release 1.2.0: auth improvements"
# Tag a specific past commit
git tag -a v1.1.1 abc1234 -m "Hotfix: XSS patch"
# List tags with details
git tag -l -n1 # one-line annotation
git tag -l 'v1.*' # filter by pattern
# Push tags to remote
git push origin v1.2.0 # push specific tag
git push origin --tags # push all tags
git push --follow-tags # push commits + annotated tags
# Verify a signed tag
git tag -v v1.2.0
# Delete a tag
git tag -d v1.1.0 # local
git push origin --delete v1.1.0 # remote
# Show tag details
git show v1.2.0
# Get latest tag on current branch
git describe --tags --abbrev=0
# Commits since last tag
git log $(git describe --tags --abbrev=0)..HEAD --oneline
# Configure GPG for signing
git config --global user.signingkey YOUR_KEY_ID
git config --global tag.gpgSign true # auto-sign tags
git config --global commit.gpgSign true # auto-sign commitsUse Cases
- Creating verified release tags
- Semantic versioning for packages
- Generating changelogs between release tags
Tags
Related Snippets
Similar patterns you can reuse in the same workflow.
bashbeginner
Git Tag Management for Releases
Create, list, push, and manage annotated and lightweight tags for version releases.
Best for: Marking release points in project history
#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