How to view changes for specific commits?​​

Looking up changes for a specific commit

If you have the hash for a commit, you can use the git show command to display the changes for that single commit. With this command you not only see the changes happened within the files but also see the new files that are added, changed and removed.


git show 402bda36a76f25377bha040d85d2b90a9724476b

The output is identical to each individual commit when using git log -p .


commit 402bda36a76f25377bha040d85d2b90a9724476b
Author: Bhavik (MM Ingress IT Solutions)
Date: Wed Aug 13 23:18:02 2019 +0530

updated image

diff --git a/images/bed-2061232_1920.jpg b/images/1.jpg
similarity index 100%
rename from images/bed-2061232_1920.jpg
rename to images/1.jpg

Commit hashes are generally unique enough for you to use the first few letters/numbers when looking up a hash rather than the full hash.

So, you can just use git show 402bda instead to get the same result.