This page is about tagging in git
Git has the ability to tag specific points in history as being important. Typically this functionality is used to mark release points (v1.0, and so on).
Git uses two main types of tags:
A tag is an object in git.
Annotated tags :
A lightweight tag is very much like a branch that doesn’t change – it’s just a pointer to a specific commit.
Lightweight tags are used:
The tag name generally starts with a v and follow the semantic version: See Code Versioning - Versioning scheme
git tag -a v1.4 9fceb02 -m "my version 1.4"
where:
To create a lightweight tag, don’t supply the -a, -s, or -m option.
git tag v1.4
With show
git show v1.4
tag v1.4
Tagger: Ben Straub <[email protected]>
Date: Sat May 3 20:19:12 2014 -0700
my version 1.4
commit ca82a6dff817ec66f44342007202690a93763949
Author: Scott Chacon <[email protected]>
Date: Mon Mar 17 21:52:11 2008 -0700
changed the version number
To lists the tags in alphabetical order
git tag
Github: for example for spark: https://api.github.com/repos/apache/spark/tags
With a pattern
git tag -l "v1.8.5*"
v1.8.5
v1.8.5-rc0
By default, the git push command doesn’t transfer tags to remote servers.
git push origin v1.5
where:
git push --delete origin tagname
git tag --delete tagname
Checkout is not a really checkout as they can't be modified
git checkout tags/tagName
# example
git checkout tags/release-1.4.0-rc1
where release-1.4.0-rc1 is the tag name
git checkout tags/v2.0.0 -b version2
Switched to a new branch 'version2'
where: