Last active
January 21, 2020 12:10
-
-
Save tomasdev/db32e6f1e47e258039faba687ae16b56 to your computer and use it in GitHub Desktop.
Guide to patch - diff (How to use patch)
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
# Create a patch file | |
diff -u file.old file.new > file.patch | |
# Apply a patch | |
patch < file.patch | |
# Create a backup before applying patch | |
patch -b < file.patch | |
# Create a versioned backup before applying patch | |
# Note: numbered is the mechanism -V uses, not free input | |
patch -b -V numbered < file.patch | |
# Validate patch without applying | |
patch --dry-run < file.patch | |
# Reverse patch (undo) | |
patch -R file.old < file.patch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment