Thoughts of Geoff

Some writing by Geoff Petrie

Git Tips: Tagging

File this under the I’m always referencing this, so I’m going to do a quick post about it category.

Tagging in Git is super powerful and can save your butt. Here are a few commands that I use often but never seem to remember.

List all your tags:

git tag


Create a tag:

git tag -a v1.4


Push tags:

git push origin v1.4

or

git push origin --tags


Checkout a tag:

git checkout -b v1.4


Deleting a tag

git tag -d v1.4


Deleting a remote tag

git push origin :v1.4


Search for specific tags:

git tag -l 'v1.0.2'


See tag data:

git show v1.4


Retroactively tag:

git tag -a v1.4 <<checksum>>


A couple of nice references on tagging:

Git Basics - Tagging
Git Ready - Tagging