Tagging in Git
git tag (lists all the tags)
git tag -l 'release-*' (allows you to filter tags matching release-*)
git tag -a <tag-name> (creates a tag. -a instructs git to store tagger's information like email, name, date etc)
git show <tag-name> (shows all the information about a tag)
You can also create tags for previous commits.
To do this, find out the checksum of the previous commit using git log --pretty=online
Then tag it normally, but specify the checksum.
Example:
git tag -a 'tag for alpha release' -m 'forgot to create tag' fga878fsdjhfd0fhd8 (The last argument is the checksum)
Tags are not pushed to remote servers by default.
To do that, use the following 2 commands:
git push <remote-name> <tag-name> (pushes the specified tag)
git push <remote-name> --tags (pushes all the tags)
Read full article from Tagging in Git - PrismoSkills
No comments:
Post a Comment