Created
May 9, 2013 23:39
-
-
Save ejhayes/5551443 to your computer and use it in GitHub Desktop.
Using git to generate patch files and patch to apply them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Take the last 2 commits from git and create a patch file | |
$ git format-patch -2 HEAD --stdout > 0001-last-2-commits.patch | |
# Doing a dry run of a patch | |
$ patch --dry-run -i 0001-last-2-commits.patch -p1 | |
patching file ... | |
# Actually applying the patch file | |
$ patch -i 0001-last-2-commits.patch -p1 | |
patching file ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment