]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/diff-options.txt
diff.c: --no-color to defeat diff.color configuration.
[thirdparty/git.git] / Documentation / diff-options.txt
CommitLineData
dda2d79a
JH
1-p::
2 Generate patch (see section on generating patches)
3
4-u::
5 Synonym for "-p".
6
5c91da25
PB
7--patch-with-raw::
8 Generate patch but keep also the default raw diff output.
9
d75f7952
JS
10--stat::
11 Generate a diffstat instead of a patch.
12
4bbd261b
SE
13--summary::
14 Output a condensed summary of extended header information
15 such as creations, renames and mode changes.
16
29353273
JS
17--patch-with-stat::
18 Generate patch and prepend its diffstat.
19
dda2d79a
JH
20-z::
21 \0 line termination on output
22
23--name-only::
24 Show only names of changed files.
25
946f5f7c
JH
26--name-status::
27 Show only names and status of changed files.
dda2d79a 28
80b1e511
JH
29--full-index::
30 Instead of the first handful characters, show full
31 object name of pre- and post-image blob on the "index"
32 line when generating a patch format output.
33
913419fc 34--abbrev[=<n>]::
47dd0d59
JH
35 Instead of showing the full 40-byte hexadecimal object
36 name in diff-raw format output and diff-tree header
89438677 37 lines, show only handful hexdigits prefix. This is
913419fc
JH
38 independent of --full-index option above, which controls
39 the diff-patch output format. Non default number of
40 digits can be specified with --abbrev=<n>.
47dd0d59 41
dda2d79a
JH
42-B::
43 Break complete rewrite changes into pairs of delete and create.
44
45-M::
46 Detect renames.
47
48-C::
49 Detect copies as well as renames.
50
147cf317
JL
51--diff-filter=[ACDMRTUXB*]::
52 Select only files that are Added (`A`), Copied (`C`),
53 Deleted (`D`), Modified (`M`), Renamed (`R`), have their
54 type (mode) changed (`T`), are Unmerged (`U`), are
55 Unknown (`X`), or have had their pairing Broken (`B`).
56 Any combination of the filter characters may be used.
57 When `*` (All-or-none) is added to the combination, all
58 paths are selected if there is any file that matches
59 other criteria in the comparison; if there is no file
60 that matches other criteria, nothing is selected.
61
dda2d79a 62--find-copies-harder::
f73ae1fc
CM
63 For performance reasons, by default, -C option finds copies only
64 if the original file of the copy was modified in the same
65 changeset. This flag makes the command
dda2d79a
JH
66 inspect unmodified files as candidates for the source of
67 copy. This is a very expensive operation for large
68 projects, so use it with caution.
69
8082d8d3
JH
70-l<num>::
71 -M and -C options require O(n^2) processing time where n
f73ae1fc 72 is the number of potential rename/copy targets. This
8082d8d3 73 option prevents rename/copy detection from running if
f73ae1fc 74 the number of rename/copy targets exceeds the specified
8082d8d3
JH
75 number.
76
dda2d79a 77-S<string>::
f73ae1fc 78 Look for differences that contain the change in <string>.
dda2d79a
JH
79
80--pickaxe-all::
81 When -S finds a change, show all the changes in that
f73ae1fc 82 changeset, not just the files that contain the change
dda2d79a
JH
83 in <string>.
84
d01d8c67
PB
85--pickaxe-regex::
86 Make the <string> not a plain string but an extended POSIX
87 regex to match.
88
dda2d79a
JH
89-O<orderfile>::
90 Output the patch in the order specified in the
91 <orderfile>, which has one shell glob pattern per line.
92
93-R::
5f3aa197 94 Swap two inputs; that is, show differences from index or
dda2d79a
JH
95 on-disk file to tree contents.
96
d507bb15
SF
97--text::
98 Treat all files as text.
99
100-a::
101 Shorthand for "--text".
102
8db9307c
JH
103For more detailed explanation on these common options, see also
104link:diffcore.html[diffcore documentation].