All commands

git show

intermediate

Dump the full anatomy of any single object.

What it does

git show prints a git object in human-readable form. Give it a commit and you get its metadata plus the diff of what it introduced. You can also show tags, trees, or a single file from any revision — all read-only.

commit74d3b9f0…
treef2b0c9d1a4e8…
parent9a2f1c0b7d3e…
authorAda <ada@dev> 12:07 +0200
committerAda <ada@dev> 12:07 +0200
messagefeat: add dark mode
treef2b0c9d1…
blob aa8f1e… README.md
blob 3c2d09… src/main.ts
tree b7e1a2… src/
blobaa8f1e…
header: blob + size
content bytes…
SHA-1 → unique key of content

git show renders a commit object's full anatomy

Watch it — press play

A narrated, step-by-step walkthrough that shows how to do it — not just theory. It adapts to the learner mode you picked in the top bar.

1 / 2

Step 1

Open one commit

git show displays the full anatomy of a single object — for a commit, that's metadata plus its diff.

git show 74d3b9f
commit74d3b9f0…
treef2b0c9d1a4e8…
parent9a2f1c0b7d3e…
authorAda <ada@dev> 12:07 +0200
committerAda <ada@dev> 12:07 +0200
messagefeat: add dark mode
treef2b0c9d1…
blob aa8f1e… README.md
blob 3c2d09… src/main.ts
tree b7e1a2… src/
blobaa8f1e…
header: blob + size
content bytes…
SHA-1 → unique key of content

tree, parent, author, committer, message — then the diff

Under the hood

1

Every object type has a renderer

git show is a dispatcher: it looks at the object type (commit / tree / blob / tag) and picks the matching pretty-printer. Commit → metadata + diff; blob → raw content; tag → tagger + message.

2

Revision:path reads a blob from history

`git show HEAD~2:src/App.tsx` resolves HEAD~2 to a commit, reads its tree, walks to src/, and prints the blob verbatim — the file as it was two commits ago, without touching the working tree.

Command anatomy

git show <rev>[<:path>]
--stat

Just a summary of files changed, not the full diff.

--no-patch

Metadata only — identity, parents, message, nothing else.

<rev>:<path>

Print that exact file's content at that revision.

When to reach for it

Reviewing a single commit in full: `git show 74d3b9f`.

Pulling a file out of history: `git show release/1.0:configs/env.js > env.js`.

Inspecting a tag object to see who tagged and when.

Practice

A real repo, pre-seeded with history, runs right here — stage, commit, branch, stash, diff, even hit and resolve a real merge conflict. Nothing to install, nothing leaves your machine.

Open practice playground

Go deeper with