git help rev-parse says:
<rev>^{}, eg v0.99.8^{} A suffix ^ followed by an empty brace pair means the object could be a tag, and dereference the tag recursively until a non-tag object is found.
Typically, you use tag^{} to refer to this commit.
You have two different types of tags:
- Lightweight tags simply indicate an existing commit
- annotated tags are those objects that have a pointer to a separate commit object
Use the git rev-parse tag to get the SHA1 of the tag itself.
Use the git rev-parse tag^{} to get the SHA1 litter fix.
For lightweight tags, both are the same. For annotated tags, they are not.
You can also use git show-ref -d tag , which will show you both the SHA1 tag and the SHA1 of the associated commit.
There is also a git show tag to give you detailed tag information (annotated).
source share