Git Revision Syntax/Pretty-print object

Display tree or commit content.

Section: Path and Object Selection

Pretty-print object

bash
bash
git cat-file -p HEAD^{tree}

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Path and Object Selection
Show object type
Inspect object type after rev resolution.
OpenIn sheetbashsame section
Show file at HEAD
Print file content from a revision.
OpenIn sheetbashsame section
Show file from branch
Read file content from another branch.
OpenIn sheetbashsame section
List tree entries
List files in a tree path.
OpenIn sheetbashsame section
Verify ref syntax
Require object to resolve to a commit.
OpenIn sheetbashsame section
Current commit
Resolve HEAD to the current commit ID.
OpenIn sheetbash1 tag match