Using GIT

From Wikichris
Jump to: navigation, search

How do you 'tag' a particular set of revisions

Using the git tag command.

To simply "tag" the current revision, you would just run..

$ git tag -a <tag_name> -m '<tag_description>'
$ git tag -a 2.61.2 -m 'description message'

To list the current tags, simply run git tag with no arguments, or -l (lower case L):

$ git tag -a <tag_name> # and enter a message, or use -m 'My tag annotation'
$ git tag -l

To delete a tag, you use the -d flag:

$ git tag -d <tag_name> 

To replace a tag, use -f to force its replacement

$ git tag -fa <tag_name> -m '<tag_description>'

To tag a specific (previous) commit, you simply do. (take it from a git log)

$ git tag <tag_name> [revision SHA1 hash]

For example:

$ git tag <tag_name> 7a4e6dec37c498847c419e1ba132af78cab2e574

Push your tag name to the remote repository

$ git push --tags

How do you pull a particular Tag / 'release'

git clone will give you the whole repository.

After the clone, you can list the tags with git tag -l and then checkout a specific tag:

$ git checkout <tag_name>