I need a git command that simply displays the SHA of an arbitrary object (commit, tree, blob, whatever). Primarily:
$ git sha HEAD
7b78f727c91edc7726f3c31113bc7b1509fea163
$ git sha master^:CHANGELOG
0dcc5f003ed89c30a8d0376a29d546c20449fd90
... etc. It should be the easiest thing in the world, but I cannot figure out how to do it. I don't mind using an alias for the complex, optional git command, but it seems like I just have to skip the very simple U-turn command, which git must be used under the hood all the time.
source
share