git show Show one commit, tag or file in detail
Prints a single object in full: for a commit it shows the message and the exact changes it made. It can also show a file as it was in an earlier commit.
Synopsis
git show [OPTION]... [OBJECT]...
Common options
| Option or form | What it does |
|---|---|
--stat | Show a summary of changed files instead of the whole patch |
--name-only | Show only the names of changed files |
--format=FORMAT | Control the heading, for example --format=%H for the full hash |
COMMIT:PATH | Print a file as it was in that commit |
-s | Suppress the diff and show only the commit message |
Examples
git show
git show 3f2a9c1
git show --stat HEAD~2
git show v1.0:README.md
git show -s --format=%H HEAD
Notes
- HEAD is the commit you are on. HEAD~1 is its parent, HEAD~2 the one before.
- Without an argument, show uses HEAD.
- Redirect old versions into a file, for example git show HEAD~3:app.js > app.old.js, to compare without checking anything out.
See also
Last reviewed 2026-10-09.