使用diff制作补丁

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

来源:http://blog.chinaunix.net/uid-21768364-id-186039.html

上一篇:Java中文字符处理的四大迷题


下一篇:BestCoder Round #78 (div.2)