Progress:
TIER 1 · MODULE 09· Basics

git show

Commit, tree, tag, blob — show what's inside.

🎯 What & why

Print one or more objects in a human-readable form. For commits: metadata + diff. For trees: like ls-tree. For tags: the tag plus the commit it points to. For blobs: the file contents.

🧠 Mental model

show is cat-file -p with formatting layered on top. It dispatches on object type. The diff for a commit is diff <parent> <commit> under the hood.

🛠️ Synopsis

git show [<options>] <object>...

🎚️ Switches & options

FlagWhat it does
--statFile-summary instead of full diff.
--name-onlyJust the changed file names.
--pretty=<format>Customize the metadata header (oneline, short, medium, full, format:%h %s etc.).
-sSuppress the diff. Just show the metadata.
--word-diffWord-level diff.

💡 Use cases

🧪 Examples

Show the most recent commit.
$ git show
Show a tree at a specific commit.
$ git show HEAD:src/
Show one file at a specific commit.
$ git show v1.2:Makefile
Just the message for a commit.
$ git show -s --format=%B HEAD~3

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.