3. Git Tags

3.1. About Tags

  • .git/refs/tags/*

3.2. Using

3.2.1. Create Tag

  • -a, --annotate - annotated tag, needs a message

  • -m, --message <message> - tag message

$ git tag -a <tag> -m <message>
$ git tag -a "v1.0.0" -m "Released on 1970-01-01"

3.2.2. Show Tags


$ git show v1.0.0 tag v1.0.0 Tagger: Mark Watney <mark.watney@nasa.gov> Date: Thu Jan 1 00:00:00 1970 +0000

released on 1970-01-01

commit 55c83ab01f804a450f9e4d6b3550c87542703937 (HEAD -> master, tag: v1.0.0, origin/master, origin/HEAD) Author: Mark Watney <mark.watney@nasa.gov> Date: Thu Jan 1 00:00:00 1970 +0000

content from master branch

diff –git a/myfile.txt b/myfile.txt index 046820b..08ac55e 100644 — a/myfile.txt +++ b/myfile.txt @@ -1 +1 @@ -Some Old Content +And Now for Something Completely Different

3.2.3. List Tags

  • -l, --list - list tag names

  • -n[<n>] - print <n> lines of each tag message

$ git tag -l

3.2.4. Delete Tag

  • -d, --delete - delete tags

$ git tag -d <tag-name>

3.3. Signing

3.3.1. Sign

  • -s, --sign - annotated and GPG-signed tag

$ git tag -s <key-path>

3.3.2. Verify Tag

  • -v, --verify - verify tags

$ git tag -v <tag-name>

3.4. Describe

$ git describe

3.5. Push

$ git push origin <tag-name>
$ git push --tags