Reputation: 87221
I need a shell command-line which puts the tree hash corresponding to a specific commit hash. I know that git cat-file commit $COMMITID | grep ^tree
can do it, but I have to filter the output of that. Is there any command which prints only the hash?
Upvotes: 9
Views: 1785
Reputation: 985
You could rev-parse
top-level directory for a commit with a traling colon :
git rev-parse ${COMMITID}:
Upvotes: 1