1、制作补丁包
命令格式 diff -uNr oldfile.c newfile.c > x.patch
2、打补丁
命令格式 patch -p0 < x.patch
总结一下:
单个文件
diff –uN from-file to-file >to-file.patch
patch –p0 < to-file.patch
patch –RE –p0 < to-file.patch
多个文件
diff –uNr from-docu to-docu >to-docu.patch
patch –p1 < to-docu.patch
patch –R –p1