diff補丁檔案解析

2021-06-16 17:48:22 字數 899 閱讀 2457

@@ -1,3 +1,9 @@

+this is an important

+notice! it should

+therefore be located at

+the beginning of this

+document!

+ this part of the

document has stayed the

same from version to

@@表示乙個區塊的開始,這個區塊到下乙個「@@」為止

-1,3表示原檔案的第1行到第3行間;

+1,9表示新檔案的第1行到第9行

第3行和第9行,這兩個行數不同,表示從原始檔到新檔案增加了幾行

帶加號(+)的行,表示增加的,不帶號的,表示原來就有的;

@@ -5,16 +11,10 @@

be shown if it doesn't

change. otherwise, that

would not be helping to

-compress the size of the

-changes.

- -this paragraph contains

-text that is outdated.

-it will be deleted in the

-near future.

+compress anything.

it is important to spell

-check this dokument. on

+check this document. on

帶減號(-)的,表示刪除了這幾行。

其餘同上。

diff製作補丁和patch打補丁

1 製作補丁 製作補丁使用diff命令 假設原始檔為 wx srcdir bak 目標檔案為 tmp new1 new2 srcdir 目標檔案是在原始檔基礎上的更新,更新之後想產生乙個補丁檔案。所謂補丁檔案,就是記錄下這兩個檔案的 異同。補丁檔案作用 公升級和備份。想做個備份為v1版本。如果把整個...

使用diff命令打補丁詳解!

對於開源原始碼修改過程中的必經階段 對原始碼打補丁,總是不夠精通,搜尋了補丁的原理的詳細過程,如下 在移植或版本公升級過程中,手動比對 用比對工具 轉換是很費力的事情,特別是發生變化的檔案非常多的情況下,製作補丁 打補丁 可以簡化這個過程。主要用到diff和patch1 diff name diff...

使用diff命令打補丁詳解!

使用diff命令打補丁詳解!分類 linux作業系統 2011 08 09 10 35 9人閱讀 0 收藏舉報 對於開源原始碼修改過程中的必經階段 對原始碼打補丁,總是不夠精通,搜尋了補丁的原理的詳細過程,如下 在移植或版本公升級過程中,手動比對 用比對工具 轉換是很費力的事情,特別是發生變化的檔案...