Git Tags and Releases
Mark release points with lightweight and annotated tags.
- git tag
- annotated tag
- git describe
- release tag
- push tags
Git Tags and Releases
Mark release points with lightweight and annotated tags.
Commands
| Command | What it does |
|---|---|
git tag | List tags |
git tag -a v1.3.0 -m "release" | Create an annotated release tag |
git tag v1.3.0-beta | Lightweight tag (pointer only) |
git push origin v1.3.0 | Publish one tag |
git push origin --tags | Publish all local tags |
git describe --tags | Nearest tag + distance, e.g. v1.3.0-4-gabc123 |
Example
git tag -a v1.3.0 -m "Search GA"
git push origin v1.3.0
git describe --tags
FAQ
Annotated vs lightweight tags?
Annotated tags store message, date, and tagger — always use them for releases; lightweight tags are throwaway pointers.
How do I delete a published tag?
Delete locally (git tag -d) and remotely (git push origin :refs/tags/<tag>), then tell the team to prune.
FAQ
Annotated vs lightweight tags?
Annotated tags store message, date, and tagger — always use them for releases; lightweight tags are throwaway pointers.
How do I delete a published tag?
Delete locally (git tag -d) and remotely (git push origin :refs/tags/<tag>), then tell the team to prune.
Git
Git Config Essentials
Set identity, defaults, and aliases for Git on a new machine.
Git Clone and Init
Start a repo from scratch or copy a remote repository locally.
Git Add and Commit
Stage changes and record them as commits with clear messages.
Git Branch Basics
Create, list, rename, and delete branches for parallel work.