What is the tree hash of a specific commit hash?

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?

  • what happened when type “cd” command to a linux git directory?
  • Git tree with selectable nodes in terminal?
  • Heroku Git - fatal: The remote end hung up unexpectedly
  • clone specific commit bitbucket
  • Can't commit update-index on Windows
  • How to refer to HEAD on a different branch?
  • git-ftp resmo git-ftp.log
  • Git can not clone repository when using bitvise ssh server
  • What does these lines do?
  • Is fork a git core concept?
  • Provide a password for the “git push” command in GitPython
  • Can git automatically split up a commit into single hunks?
  • 2 Solutions collect form web for “What is the tree hash of a specific commit hash?”

    git log -1 --pretty="%T" $COMMITID 
    git rev-parse $COMMITID^{tree}
    Git Baby is a git and github fan, let's start git clone.