Tagging Releases
Tags are like bookmarks for specific commits. They are often used to mark release points like
v1.0, v2.1, etc. Unlike branches, tags are static – they don’t move when you make new commits.Types of Tags
Git supports two types of tags:
- Lightweight tags: Just a pointer to a commit (like a branch that doesn’t move).
- Annotated tags: Stored as full objects with metadata (tagger, date, message, optional GPG signature). Recommended for releases.
Creating Tags
Lightweight tag:
git tag v1.0Annotated tag:git tag -a v1.0 -m "First release"Listing Tags
See all tags:
git tagFor detailed information on annotated tags:git show v1.0Sharing Tags
By default,
git push does not upload tags. You need to push tags explicitly:git push origin v1.0Or push all tags at once:git push --tagsDeleting Tags
Delete a local tag:
git tag -d v1.0Delete a remote tag:git push origin --delete v1.0Two Minute Drill
- Tags mark specific commits, often releases.
- Lightweight tags:
git tag tagname; annotated tags:git tag -a tagname -m "message". - List tags with
git tag. - Push tags with
git push origin tagnameorgit push --tags. - Delete tags with
git tag -d tagname(local) andgit push origin --delete tagname(remote).
Need more clarification?
Drop us an email at career@quipoinfotech.com
