Possible Duplicate:
How to retrieve the hash for the current commit in Git?
I.e. what's the git equivalent of hg parent
or svn info
.
Extra points for an answer that I can use in a script, i.e. It gives 'bbh653ad' rather than a load of words which contain the version number somewhere
To get the hash of the HEAD, use this command:
git rev-parse HEAD
or for the short form:
git rev-parse --short HEAD
If you have tags and you are looking for a more descriptive revision number, you can consider using the result of the command:
git describe --long
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With