Skip to content

Instantly share code, notes, and snippets.

@eegrok
Created February 28, 2013 22:52
Show Gist options
  • Save eegrok/5060836 to your computer and use it in GitHub Desktop.
Save eegrok/5060836 to your computer and use it in GitHub Desktop.
save patch / apply it using git
#this will save off a single commits patch, so you can apply it
# if you leave off from --stdout to the right, it'll create a patchfile in the current directory with a name
# that includes the comment from the commit
git format-patch -1 095e61f --stdout > /tmp/patchname.patch
# this will check the patch to see if any conflicts will arise when applying it
git apply --check /tmp/patchname.patch
# this will apply the patch
git apply /tmp/patchname.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment