Skip to main content

Sign in

Save your progress and access it from any device.

Or with email

Don't have an account?

Privacy policy

Git show: inspect a commit in detail

git show displays the full contents of a commit, tag or Git object. The diff, the metadata, everything you need to know about a specific commit.

Inspection

What is git show?

git show displays the full detail of a Git object: commit, tag, tree or blob. By default, it shows the latest commit with its complete diff.

It's your magnifying glass for examining a commit in detail: who made it, when, why, and exactly which lines changed.

Git show syntax

git show

Display the latest commit

git show <hash>

Display a specific commit

git show hash:file

Display a file at a given commit

Git show in practice

Inspect commits, tags and files.

Display a commit

Files and tags

Essential show commands

git show HEAD

Latest commit with diff

git show --stat

Summary of modified files

git show --name-only

List of modified files

git show hash:file

File contents at a commit

git show hash -- file

Diff of a file in a commit

git show v1.0.0

Tag details

Common mistakes with git show

Confusing show and log

show displays ONE object in detail, log displays the history. Use log to search, show to inspect.

Forgetting the hash:file syntax

To view a file at a given commit, it's hash:path (colon). For the diff of a file, it's hash -- path (dashes).

Diff too long

If the diff is very long, use --stat for a summary or pipe to less: git show | less.

Part of the Git History, Search & Debug guide

A

GitQuest is created by Anaïs (nouvelle fenêtre), web developer and head of education, specializing in tech training and digital accessibility.

Questions about git show

Become a Git detective with GitQuest

Learn to inspect history and understand every change.

Start the investigations