diff 用法

diff -Naur [from-file] [to-file] > [YourFileName.patch]
-N    In  directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory.
-a    Treat  all  files as text and compare them line-by-line, even if they do not seem to be text.
-u    Use the unified output format.
-r    When comparing directories, recursively compare any subdirectories found.

所以一般檔案內容異動只要 diff -u [from-file] [to-file] > [YourFileName.patch] 應該就可以了。

如果改的東西很多,應該就用 diff -Naur [from-file] [to-file] > [YourFileName.patch]

留言

這個網誌中的熱門文章

直行橫列,以及 line (列/行), column (欄), row (列)

Permission 取用權/權能; Permission denied 取用遭拒; Ask for permission 請求取用權/權能; Don't have the right permission to 無權/沒有權能

正體中文、繁體中文?