1. 程式人生 > >生成patch檔案、給原始碼打patch

生成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 選項要從當前目錄查詢目的檔案(夾)