Loading lessons...
Git Show
Git Show
git show displays details about a single commit, including what changed in it.
Show the latest commit
git show
This shows the most recent commit: the author, date, message, and the full diff of what changed.
Show a specific commit
git show abc123
Replace abc123 with the commit's hash (you can use just a few characters of it).
Show a file in a commit
git show abc123:index.html
The colon : lets you peek at what a file looked like at that commit.
Show a branch or tag
git show main
git show v1.0
git show works with any name that points to a commit.
When to use show vs diff
- Use
git showto inspect one commit in detail. - Use
git diffto compare two commits or see current uncommitted changes.
TL;DR
git showinspects a single commit.git show hashshows a specific commit.git show hash:fileshows a file at that commit.- It works with branches and tags too.