git cat-file -p <commit>
This command is useful when you need to peek under the hood of a specific Git commit to see its raw metadata and message in plain text.
It leverages the low-level plumbing command cat-file along with the -p (or --pretty) flag to render a commit object into a human-readable form; you supply a commit identifier such as a SHA-1 hash, HEAD, HEAD~1, or any ref in place of <commit>, and Git prints the object’s tree reference, parent(s), author and committer information, and the commit message.
To only view an object’s type you can use git cat-file -t <object>, or process multiple objects in one session with git cat-file --batch or --batch-check; for a quick overview or diff of a commit consider git show <commit>, and to inspect blob or tree contents you can still use git cat-file -p <blob_or_tree_id>.
Examples:
git cat-file -p a1b2c3d4e5f6g7h8i9j0git cat-file -p HEAD