Generate Patch
diff -u version1 version2 > change.patch
Apply patch
patch -p1 version1 < change.patch
will change version1 to be the same with version2
if run once more
patch -p1 version1<change.patch
Reversed (or previously applied) patch detected! Assume -R? [n] y
will reverse version1 to the original version1
patch -p1 version2<change.patch
Reversed (or previously applied) patch detected! Assume -R? [n] y
will change version2 to be the same with version1
if run once more
patch -p1 version2<change.patch
will reverse version2 to the original version2
if your need patch fold
like linux kernel patch
diff -Nur fold1 fold2 > change.path
网友评论