Created
February 25, 2013 15:09
-
-
Save compor/5030424 to your computer and use it in GitHub Desktop.
create and apply a patch between files in two directories
This file contains 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
# produces a patch between the files in the 2 dirs | |
# -c : special context for output | |
# -r : directory recursively | |
# -B : ignore blanks | |
diff -crB before_dir after_dir > foo.patch | |
# if you want to patch before_dir now | |
cd before_dir | |
# -p n : strip the smallest prefix containing n number of slashes | |
# you can do a dry run by adding --dry-run | |
# or use a backup of the file before it gets patched with -b | |
patch -p1 < ../foo.patch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment