If you want to refer to a commit, you don’t need to know that full hash id. The short version is fairly sufficient in most cases. You can get the the short hash of your current
HEAD with the following command:
You can also replace
HEAD with the full hash of a commit to get the short hash of that one.
[sc name=”src” url=”https://stackoverflow.com/questions/5694389/get-the-short-git-version-hash” ]