How to Show Git Commit Hash for Tags
To list the commit hash for every tag in a repo use:
git show-ref --tags
which yields something like:
ee02aa7363f9988af700ab136a219c455cab4b5f refs/tags/v.0.4.0
2d5befba5bc80a69c6308d2a5da965488e6bf9d7 refs/tags/v.0.4.1
0099c11405a3ace8ee14b0881f9677bfc1e30f5e refs/tags/v0.4.1
To only list the commit hash for a particular tag use:
git show-ref tag_name
for example, to list the commit hash for v0.4.1 use:
git show-ref v0.4.1
which gives you a single hash:
0099c11405a3ace8ee14b0881f9677bfc1e30f5e refs/tags/v0.4.1
To display the contents of a hash use:
git show hash