Tag Creation Techniques
Lightweight Tag Creation
Lightweight tags are simple references to specific commits, created 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 Tag Creation
Annotated tags include comprehensive metadata, providing more context and information.
## Create annotated tag with message
git tag -a v1.0.2 -m "Release version 1.0.2"
## Create annotated tag with detailed message
git tag -a v1.0.3 -m "Major release
- Added new features
- Improved performance
- Fixed critical bugs"
Tag Naming Conventions
Convention |
Example |
Description |
Semantic Versioning |
v1.2.3 |
Major.Minor.Patch |
Date-based |
2023.06.15 |
Year.Month.Day |
Feature-based |
feature-login-v1 |
Descriptive tag names |
Tag Creation Workflow
graph LR
A[Commit Changes] --> B[Select Commit]
B --> C{Tag Type}
C -->|Lightweight| D[Simple Tag]
C -->|Annotated| E[Detailed Tag]
D --> F[Create Tag]
E --> F
Advanced Tag Creation Techniques
## Push a specific tag to remote repository
git push origin v1.0.2
## Push all tags to remote repository
git push origin --tags
Tag Verification and Inspection
## List all tags
git tag
## Show details of a specific tag
git show v1.0.2
## Verify tag cryptographically
git tag -v v1.0.2