git show
View the full details of any Git object
Practical example
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.
Master Git log, diff, and blame offline
Read advanced graph traversals, patch analysis, and investigation workflows in the 97-page offline course — ₹499.
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
- Tutorial
Git Log Formats: Customize Your History Output
Master git log with custom formats, filters, and graph views. Learn the format placeholders that turn raw history into a readable, useful log.
7 min readRead guide - Tutorial
Git Diff: Compare Changes Across Commits and Branches
See exactly what changed between commits, branches, or your working directory. Master git diff for thorough code reviews.
5 min readRead guide - Tutorial
Git Blame: Track Changes Back to Their Author
Use git blame to find who last modified every line of a file. Essential for code review, debugging, and understanding project history.
4 min readRead guide
Related commands
More from Inspecting History