git-ls-files: add --exclude-standard
[git/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
4eb99473
RR
7-U<n>::
8 Shorthand for "--unified=<n>".
9
10--unified=<n>::
11 Generate diffs with <n> lines of context instead of
12 the usual three. Implies "-p".
13
b5376648
JH
14--raw::
15 Generate the raw format.
16
5c91da25 17--patch-with-raw::
b5376648 18 Synonym for "-p --raw".
5c91da25 19
5c5b2ea9
LT
20--stat[=width[,name-width]]::
21 Generate a diffstat. You can override the default
22 output width for 80-column terminal by "--stat=width".
23 The width of the filename part can be controlled by
24 giving another width to it separated by a comma.
d75f7952 25
74e2abe5
JH
26--numstat::
27 Similar to \--stat, but shows number of added and
28 deleted lines in decimal notation and pathname without
2f89543e
JH
29 abbreviation, to make it more machine friendly. For
30 binary files, outputs two `-` instead of saying
31 `0 0`.
74e2abe5 32
ebd124c6
NP
33--shortstat::
34 Output only the last line of the --stat format containing total
35 number of modified files, as well as number of added and deleted
36 lines.
37
4bbd261b
SE
38--summary::
39 Output a condensed summary of extended header information
40 such as creations, renames and mode changes.
41
29353273 42--patch-with-stat::
b5376648 43 Synonym for "-p --stat".
29353273 44
dda2d79a 45-z::
654a7ccc
JH
46 NUL-line termination on output. This affects the --raw
47 output field terminator. Also output from commands such
48 as "git-log" will be delimited with NUL between commits.
dda2d79a
JH
49
50--name-only::
51 Show only names of changed files.
52
946f5f7c
JH
53--name-status::
54 Show only names and status of changed files.
dda2d79a 55
b5376648
JH
56--color::
57 Show colored diff.
58
59--no-color::
60 Turn off colored diff, even when the configuration file
61 gives the default to color output.
62
f59a59e2
JS
63--color-words::
64 Show colored word diff, i.e. color words which have changed.
65
b5376648
JH
66--no-renames::
67 Turn off rename detection, even when the configuration
68 file gives the default to do so.
69
16507fcf
BL
70--check::
71 Warn if changes introduce trailing whitespace
72 or an indent that uses a space before a tab.
73
80b1e511
JH
74--full-index::
75 Instead of the first handful characters, show full
76 object name of pre- and post-image blob on the "index"
b5376648
JH
77 line when generating a patch format output.
78
79--binary::
80 In addition to --full-index, output "binary diff" that
81 can be applied with "git apply".
80b1e511 82
913419fc 83--abbrev[=<n>]::
47dd0d59
JH
84 Instead of showing the full 40-byte hexadecimal object
85 name in diff-raw format output and diff-tree header
89438677 86 lines, show only handful hexdigits prefix. This is
913419fc
JH
87 independent of --full-index option above, which controls
88 the diff-patch output format. Non default number of
89 digits can be specified with --abbrev=<n>.
47dd0d59 90
dda2d79a
JH
91-B::
92 Break complete rewrite changes into pairs of delete and create.
93
94-M::
95 Detect renames.
96
97-C::
ca6c0970 98 Detect copies as well as renames. See also `--find-copies-harder`.
dda2d79a 99
147cf317
JL
100--diff-filter=[ACDMRTUXB*]::
101 Select only files that are Added (`A`), Copied (`C`),
102 Deleted (`D`), Modified (`M`), Renamed (`R`), have their
103 type (mode) changed (`T`), are Unmerged (`U`), are
104 Unknown (`X`), or have had their pairing Broken (`B`).
105 Any combination of the filter characters may be used.
106 When `*` (All-or-none) is added to the combination, all
107 paths are selected if there is any file that matches
108 other criteria in the comparison; if there is no file
109 that matches other criteria, nothing is selected.
110
dda2d79a 111--find-copies-harder::
ca6c0970 112 For performance reasons, by default, `-C` option finds copies only
a6080a0a 113 if the original file of the copy was modified in the same
f73ae1fc 114 changeset. This flag makes the command
dda2d79a
JH
115 inspect unmodified files as candidates for the source of
116 copy. This is a very expensive operation for large
ca6c0970
JS
117 projects, so use it with caution. Giving more than one
118 `-C` option has the same effect.
dda2d79a 119
8082d8d3
JH
120-l<num>::
121 -M and -C options require O(n^2) processing time where n
f73ae1fc 122 is the number of potential rename/copy targets. This
8082d8d3 123 option prevents rename/copy detection from running if
f73ae1fc 124 the number of rename/copy targets exceeds the specified
8082d8d3
JH
125 number.
126
dda2d79a 127-S<string>::
f73ae1fc 128 Look for differences that contain the change in <string>.
dda2d79a
JH
129
130--pickaxe-all::
131 When -S finds a change, show all the changes in that
f73ae1fc 132 changeset, not just the files that contain the change
dda2d79a
JH
133 in <string>.
134
d01d8c67
PB
135--pickaxe-regex::
136 Make the <string> not a plain string but an extended POSIX
137 regex to match.
138
dda2d79a
JH
139-O<orderfile>::
140 Output the patch in the order specified in the
141 <orderfile>, which has one shell glob pattern per line.
142
143-R::
5f3aa197 144 Swap two inputs; that is, show differences from index or
dda2d79a
JH
145 on-disk file to tree contents.
146
d507bb15
SF
147--text::
148 Treat all files as text.
149
150-a::
151 Shorthand for "--text".
152
a44a0c99
JH
153--ignore-space-at-eol::
154 Ignore changes in white spaces at EOL.
155
8ebe185b
JN
156--ignore-space-change::
157 Ignore changes in amount of white space. This ignores white
158 space at line end, and consider all other sequences of one or
159 more white space characters to be equivalent.
160
161-b::
162 Shorthand for "--ignore-space-change".
163
164--ignore-all-space::
165 Ignore white space when comparing lines. This ignores
166 difference even if one line has white space where the other
167 line has none.
168
169-w::
170 Shorthand for "--ignore-all-space".
171
41bbf9d5
AR
172--exit-code::
173 Make the program exit with codes similar to diff(1).
174 That is, it exits with 1 if there were differences and
175 0 means no differences.
176
2a18c266
AR
177--quiet::
178 Disable all output of the program. Implies --exit-code.
179
72909bef
JS
180--ext-diff::
181 Allow an external diff helper to be executed. If you set an
63a1f810
SP
182 external diff driver with gitlink:gitattributes[5], you need
183 to use this option with gitlink:git-log[1] and friends.
72909bef
JS
184
185--no-ext-diff::
186 Disallow external diff drivers.
187
8db9307c
JH
188For more detailed explanation on these common options, see also
189link:diffcore.html[diffcore documentation].