Lightweight tags are simple pointers to specific commits, created quickly without additional metadata.
## Create lightweight tag at current commit
git tag v1.0.0
## Create lightweight tag at specific commit
git tag v1.0.1 <commit-hash>
Annotated tags store comprehensive information about the release.
## Create annotated tag with message
git tag -a v1.1.0 -m "Major Feature Release"
## Create annotated tag with detailed message
git tag -a v1.2.0 -m "Added authentication module
- Implemented user login
- Enhanced security features"
Tag Management Workflow
gitGraph
commit
commit
tag: v1.0.0
commit
tag: v1.1.0
commit
tag: v1.2.0
Operation |
Command |
Description |
Local Tag Deletion |
git tag -d v1.0.0 |
Remove tag from local repository |
Remote Tag Deletion |
git push origin :refs/tags/v1.0.0 |
Remove tag from remote repository |
Advanced Tag Pushing
## Push specific tag to remote
git push origin v1.1.0
## Push all tags to remote
git push origin --tags
Tag Verification
## List all tags
git tag
## Show tag details
git show v1.1.0