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 formWhat it does
--statShow a summary of changed files instead of the whole patch
--name-onlyShow only the names of changed files
--format=FORMATControl the heading, for example --format=%H for the full hash
COMMIT:PATHPrint a file as it was in that commit
-sSuppress the diff and show only the commit message

Examples

Show the latest commit
git show
Show a specific commit
git show 3f2a9c1
See only which files changed
git show --stat HEAD~2
Read an old version of a file
git show v1.0:README.md
Get just the full hash of HEAD
git show -s --format=%H HEAD

Notes

See also

Last reviewed 2026-10-09.