Tags and Aliases

Working With Tags

To list your tags

$ git tag

To look for a specific tag, run the command

$ git tag -l "v1.8.5*"

To create annotated tags

$ git tag -a v1.4 -m "my version 1.4"

To see the tag data

$ git show v1.4

To create lightweight tags

$ git tag v1.4-lw

If you want to create a tag later, after the commit

$ git tag -a v1.2 _COMMIT_ID_

To push tags to a shared server

$ git push origin v1.5

To push a lot of tags to a shared server simultaneously

$ git push origin --tags

To checkout to a tag

$ git checkout 2.0.0

If you need to fix a bug on an older version you will want to create a branch and commit the changes there

$ git checkout -b version2 v2.0.0