What Are Git Tags?
Git tags come in two flavors:
- Lightweight tags: Simple pointers to a commit (no additional metadata).
- Annotated tags: Store extra information such as author, date, and a message—ideal for official releases.
Why Use Git Tags?
- Release Management: Mark stable builds for deployment or distribution.
- Version Tracking: Easily reference past states of your codebase.
- Collaboration: Communicate release points to team members or CI/CD pipelines.
Common Git Tag Commands
| Command | Description |
|---|---|
git tag v1.0.0 | Create a lightweight tag |
git tag -a v1.0.0 -m "Release version 1.0.0" | Create an annotated tag |
git tag | List all local tags |
git push origin v1.0.0 | Push a specific tag to the remote |
git push origin --tags | Push all local tags to the remote |
Managing Tags in the Azure DevOps UI
Azure DevOps also offers a visual interface to streamline tag management:
- Create new tags without using the CLI
- Search and filter existing tags
- View tag details at a glance