Nov 12, 2019
hahal3 i3d28c8f2f5
m96k53rlnc says: April 7, 2022 at 9:22 pm.
godirld 242226f35d
A:
You need to use.diff to compare files from different revisions and print only the changed lines.
From the documentation:
.diff
The.diff
command prints out the lines that differ between the named files. In
the case of a single file: Only the changes since the last commit
are printed. In the case of two files that have been compared: the
changes since the last commit for each file are printed.
.diff --strip-trailing-cr
The
.diff --strip-trailing-cr
command prints out the lines that differ between the named files. In
the case of a single file: Only the changes since the last commit
are printed. In the case of two files that have been compared: the
changes since the last commit for each file are printed. However, if
the files are from different revisions, the differences in leading
and trailing characters (i.e. the characters between two empty
lines) are not stripped.
.diff --strip-trailing-cr --strip-trailing-lf --strip-trailing-cr-consecutive-space
Same as above, but also removes any consecutive trailing and leading
CR and LF characters.
.diff --strip-trailing-cr --strip-trailing-cr-consecutive-space --strip-trailing-lf
Same as above, but also removes any consecutive trailing and leading
CR and LF characters.
Example:
$ git diff file1.txt file2.txt
5a0b3f8ba85d7c2d8d1b07af39dc8f13e489c83f file1.txt
f3b6a20fbbad5a3b1b24954e4cf9c8842a408a41 file2.txt
$ git diff --strip-trailing-cr file1.txt file2.txt
2b82f5d737f4c06ba2a9a5b7094c4e0a01db8 be359ba680
Related links:
Comments