Today’s entry includes two tips for the price of one! I’ll show you how to use git with Powershell to see all the files that changed between two commits. I’ll also show you a quick and easy way to determine when a particular file was removed from source control.
[more]
First, let’s pretend that you want to see all the files that changed in the last month. Find the hash of the first commit of the month, then use the ‘git diff’ command to see what’s changed:
git diff <commit hash here> HEAD --name-only
What if you only care about JavaScript files? Pipe the output through Powershell:
git diff <commit hash here> HEAD --name-only | sls -SimpleMatch ".js"
Another handy trick: how do you determine when a particular file was deleted? Use ‘git log’:
git log -- /path/to/file/that/was/removed
These are simple tricks, but useful, especially when you’re doing peer reviews on a story that stretches across many commits.