I keep having to look up [patching with git diff](http://tamsler.blogspot.com/2009/02/patching-with-git-diff.html) to remember the syntax whenever I want to create and apply a patch file.
Solution?
Create an alias for it. It only uses one file, /tmp/patchfile
, so don’t try to manage multiple patches with this (maybe I’ll make more intelligent/sophisticated someday.
In my .zlogin
, I now have:
alias makepatch='git diff --no-prefix > /tmp/patchfile'
alias applypatch='patch -p0 < /tmp/patchfile'
To create a patch, makepatch
To apply a patch, applypatch