Marking Releases With Git

From Littledamien Wiki
Revision as of 17:24, 8 April 2016 by Video8 (talk | contribs) (Created page with "Category:Git Category:Web Development == Overview == Using the `git tag` command to mark releases. <ref>[https://git-scm.com/book/en/v2/Git-Basics-Tagging Git Basics...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview[edit]

Using the git tag command to mark releases. [1]

Listing tags[edit]

  • git tag lists existing tags
  • git tag -l v1.8.* searches existing tags using a pattern

Annotated tags[edit]

  • "Lightweight tags" are pointers to specific commits and don't do much else.
  • "Annotated tags" are required to mark a version in the repo, and on GitHub.
$ git tag -a v1.4 -m "my version 1.4"
$ git tag
v0.1
v1.3
v1.4
  • -a indicates an annotated tag
  • -m is the message to store with the tag

git show v1.4 will display all the data associated with the tag

Tags can be added after the fact using the checksum of a commit, e.g. git tag -a v1.2 9fceb02

Pushing tags to GitHub[edit]

Tags are not automatically sent along when pushing a branch. For example they will not show up on GitHub until they are manually pushed, e.g. git push origin v1.4.

References[edit]

  1. Git Basics - Tagging, Git documentation