git cat-file

A low-level command that prints a Git object's type (-t), size (-s) or contents (-p) given its ID or another revision.

In more detail

git cat-file -p HEAD prints the current commit's text: tree, parent, author, committer and message. It is how you prove what Git actually stores rather than trusting a summary. --batch-all-objects with --batch-check lists every object in the repository.

Examples

git cat-file -t HEAD
git cat-file -p :notes.txt

Related terms

Taught in

References