I showed you one way that you can quickly see what’s changed back in Part 6 by comparing two commits. You can also see what changed in a specific commit and fire up your git diff tool for each change. I’ll show you how in this post.
You can see a list of all the files that changed in a commit by getting its hash and using the ‘git show’ command:
#Get the hash of the desired commit with 'git log' $Hash = "hash-here" git show --pretty="format:" --name-only $Hash
This will spit out the name of each file that changed, one per line. Here’s an example from my test repo:
Another command I sometimes use allows me to see details on what’s changed between two commits, one file at a time:
#Get the hash of the desired commit with 'git log' $Hash = "hash-here" git difftool "$Hash~1" $Hash
You’ll be given the option to view each affected file in your configured diff tool (just press enter) or to skip it and move to the next file (press ‘n’):