Skip to main content
Back to command reference
Inspecting History

git show

View the full details of any Git object

Practical example

bash
git show HEAD                  # show details of latest commit
git show HEAD~2               # show the commit two before HEAD
git show --stat abc1234       # summary of a specific commit

Command overview & how it works

Displays the complete content of a Git object — most commonly a commit. For a commit, git show shows the diff (similar to git log -p) plus the commit metadata. For tags, it shows the tag message and the referenced commit. For trees and blobs, it shows directory contents or file contents respectively. By default, git show shows HEAD. Specify any reference: git show main, git show v1.0.0, git show abc1234 (partial hash), or git show HEAD~3 (3 commits before HEAD). Use git show --name-only to show only file names, or git show --stat for a compact summary. This command is invaluable for quickly inspecting a specific commit during code review or debugging without digging through the full log.

Chapter 08 · History & Diff Mastery

Master Git log, diff, and blame offline

Read advanced graph traversals, patch analysis, and investigation workflows in the 97-page offline course — ₹499.

Learn more

Practical tips

  • Use git show <hash> to inspect a single commit during review instead of scanning the whole log.
  • git show --stat gives a compact summary and --name-only lists just the files that changed.
  • You can show any object — a tag (git show v1.0.0) or a file at a commit (git show HEAD:src/index.ts) — not just commits.

Deep-dive guides & tutorials

In-depth walkthroughs and practical scenarios related to git show

All guides →

Related commands

More from Inspecting History