How to View a Specific Commit in Git (git show)
git show displays detailed information about a single commit, including its metadata and the full diff it introduced.
Published September 29, 2026
git show displays the details of a commit (author, date, message and diff), a tag or any other object.
How it works
Give it a hash, branch or tag. Combine with --stat for a summary or a path to see a file at a certain commit.
git show <commit>:<path> prints a file's content as it was.
Try it
git show a1b2c3d --stat
commit a1b2c3d Author: Ada Fix login
src/login.js | 4 ++--
Practical examples
Latest commit
git showA commit's changed files
git show a1b2c3d --statFile at a past commit
git show a1b2c3d:src/app.jsAnnotated tag
git show v1.0.0Common mistakes
- Using abbreviated hashes that are ambiguous.
- Expecting a diff for merge commits without --first-parent or -m.
- Missing that show works on tags too.
Key takeaways
- show = commit details + diff.
- commit:path prints old file versions.
- --stat summarises.
FAQ
show vs log -p?
show is for one object; log -p walks many commits.
Show HEAD's parent?
git show HEAD~1.