zsh alias to make and apply patch with git diffPosted: May 6, 2014 | Author: ThomasPowell | Filed under: daily learning | Tags: git, patch, zsh | Leave a comment »
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.
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.
.zlogin, I now have:
alias makepatch='git diff --no-prefix > /tmp/patchfile' alias applypatch='patch -p0 < /tmp/patchfile'
To create a patch,
To apply a patch,