git show

Show one commit: its message, author and every change in it

What it does

git show prints the details of a commit: hash, author, date, message and the diff of what it changed. With no arguments it shows the last commit, HEAD.

Name a commit by its hash from git log (the first seven characters are enough) or relatively: HEAD~1 is the one before, HEAD~2 earlier still. And git show <commit>:<file> prints the whole file as it was in that commit.

Syntax

git show
git show <commit>
git show <commit>:<file>

Examples

Related commands

Practise · All commands