*** file1 2019-01-08 23:00:39.033653619 -0500 --- file2 2019-01-08 23:02:27.115428654 -0500 *************** *** 1,8 **** line 1 ! line 2 line 3 - line 4 - line 5 line x line y line z \ No newline at end of file --- 1,6 ---- line 1 ! line two line 3 line x line y line z \ No newline at end of file
Diff with unified context
1
diff -u file1 file2
output
1 2 3 4 5 6 7 8 9 10 11 12 13
--- file1 2019-01-08 23:00:39.033653619 -0500 +++ file2 2019-01-08 23:02:27.115428654 -0500 @@ -1,8 +1,6 @@ line 1 -line 2 +line two line 3 -line 4 -line 5 line x line y line z \ No newline at end of file
Generate Patch for a file
1
diff -u file1 file2 > file.patch
file.path content
1 2 3 4 5 6 7 8 9 10 11 12 13
--- file1 2019-01-08 23:00:39.033653619 -0500 +++ file2 2019-01-08 23:02:27.115428654 -0500 @@ -1,8 +1,6 @@ line 1 -line 2 +line two line 3 -line 4 -line 5 line x line y line z \ No newline at end of file