Article From:https://www.cnblogs.com/onecan/p/9967493.html

1 Patch Generation

Using diff instruction to generate patch file

1.1 Generation Instruction for Single File

diff -up File 1 File 2 & gt; patch_test.patch

Parameter interpretation:
u: Show the front and back rows (context) of different rows, default is 3 rows each.
p: Display information about the C function where the code is located

1.2 Generation instructions for two folders

diff -uprN Folder 1 Folder 2 & gt; patch_test.patch

Parameter interpretation:
u: Show the front and back rows (context) of different rows, default is 3 rows each.
p: Display information about the C function where the code is located
r: The recursive execution diff, because it is two folders, requires recursive use
N: Assuming that the file does not exist, the empty file

Post Views: 1

Leave a Reply

Your email address will not be published. Required fields are marked *