How to show recent commits affecting a particular file
For example, to see the last 5 commits that changed package.json
,
git log -n5 package.json
To see the changesets, or patches, of those commits, use the -p
flag,
git log -p -n5 package.json