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:
or for the short form:
If you have tags and you are looking for a more descriptive revision number, you can consider using the result of the command: