Git Tagging
Like most Version Control Systems (VCSs), Git has the ability to tag specific points in history as being important. Typically people use this functionality to mark release points (v1.0, and so on).
Listing all available tags
Section titled “Listing all available tags”Using the command git tag lists out all available tags:
$ git tag<output follows>v0.1v1.3Note: the tags are output in an alphabetical order.
One may also search for available tags:
$ git tag -l "v1.8.5*"<output follows>v1.8.5v1.8.5-rc0v1.8.5-rc1v1.8.5-rc2v1.8.5-rc3v1.8.5.1v1.8.5.2v1.8.5.3v1.8.5.4v1.8.5.5Create and push tag(s) in GIT
Section titled “Create and push tag(s) in GIT”Create a tag:
git tag < tagname >This will create a local tag with the current state of the branch you are on.
git tag tag-name commit-identifierThis will create a local tag with the commit-identifier of the branch you are on.
Push a commit in GIT:
git push origin tag-namegit push origin --tagsSyntax
Section titled “Syntax”git tag [-a | -s | -u < keyid >] [-f] [-m < msg > | -F < file >] < tagname > [< commit > | < object >]
git tag [-n[< num >]] -l [--contains < commit >] [--contains < commit >] [--points-at < object >] [--column[=< options >] | --no-column] [--create-reflog] [--sort=< key >] [--format=< format >] [--[no-]merged [< commit >]] [< pattern >…]