生成patch文件、给源码打patch


1.  svn生成patch:
svn diff > patch.diff / /整个工程的变动生成patch
或svn diff file > patch.diff //某个文件单独变动的patch

2.  cvs生成patch:
cvs diff -u > patch.diff

3.  生成diff文件:
目录:diff -uprN linux-2.6.28.8.orig/net/sunrpc/ linux-2.6.28.8/net/sunrpc/  >patch.diff
文件:diff -up linux-2.6.28.8/net/sunrpc/svc.orig.c linux-2.6.28.8/net/sunrpc/svc.c >patch.diff

4.  打patch:
patch -p0 < patch.diff  //-p0 选项要从当前目录查找目的文件(夹)

 

你可能感兴趣的:(生成patch文件、给源码打patch)