Does anyone have an example of using git hash-object on a directory? It works easily enough on a file* but doesn\'t work as I\'d expect for a directory**
*:
I'm not sure about getting the hash for a directory outside of a git repository, but for a directory inside of a repository, try this to print only the hash:
git rev-parse HEAD:some/directory
There is no need to use other commands that require additional processing.
This will also work but provides additional information you may not want (such as the file mode and other data):
git ls-tree HEAD some/directory