Skip to content

Instantly share code, notes, and snippets.

@robbwagoner
Last active August 10, 2017 17:16
Show Gist options
  • Save robbwagoner/cd7617aa99fcf4243091b7fc4bdf1ea4 to your computer and use it in GitHub Desktop.
Save robbwagoner/cd7617aa99fcf4243091b7fc4bdf1ea4 to your computer and use it in GitHub Desktop.
Patching in Git
#
# Create patch from SHA
# http://stackoverflow.com/questions/6658313/generate-a-git-patch-for-a-specific-commit
# --stdout option is available, too
git format-patch -1 <sha>
#
# Apply Patch
# https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/
# --stat option will show what changes are applied by the .patch
# if there are rejects, the patch will not proceed. --rej will force to proceed and create .rej files
git apply 0001-name-of-patch-file.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment