so the git tag command lists the current git tags
tag1
tag2
git tag -n prints tag’s message
tag1 blah blah
tag2 blah blah
What’s the best way to get the hash of tag1 & tag2 ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To get git tags with the SHA1 hash of the Tag object, you can run:
The output will then look something like:
Each line is the SHA1 hash of the tag, followed by the tag name prefixed with
refs/tags/.If you want the SHA1 hash of the commit, instead of the tag object, you can run:
This will produce output like:
The lines ending with
^{}start with the SHA1 hash of the actual commit that the tag points to.