Skip to content

Instantly share code, notes, and snippets.

@wjlafrance
Created May 8, 2013 16:40
Show Gist options
  • Save wjlafrance/5541744 to your computer and use it in GitHub Desktop.
Save wjlafrance/5541744 to your computer and use it in GitHub Desktop.
Take the diff of the latest commit (difference between HEAD and the prior commit) and put it in patch.txt. Useful for code reviews and stuff.
git diff `git log -n1 --skip 1 | grep commit | awk '{print $2}'` HEAD > patch.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment