1-p::
2Generate patch (see section on generating patches)
34
-u::
5Synonym for "-p".
67
--raw::
8Generate the raw format.
910
--patch-with-raw::
11Synonym for "-p --raw".
1213
--stat[=width[,name-width]]::
14Generate a diffstat. You can override the default
15output width for 80-column terminal by "--stat=width".
16The width of the filename part can be controlled by
17giving another width to it separated by a comma.
1819
--numstat::
20Similar to \--stat, but shows number of added and
21deleted lines in decimal notation and pathname without
22abbreviation, to make it more machine friendly. For
23binary files, outputs two `-` instead of saying
24`0 0`.
2526
--shortstat::
27Output only the last line of the --stat format containing total
28number of modified files, as well as number of added and deleted
29lines.
3031
--summary::
32Output a condensed summary of extended header information
33such as creations, renames and mode changes.
3435
--patch-with-stat::
36Synonym for "-p --stat".
3738
-z::
39\0 line termination on output
4041
--name-only::
42Show only names of changed files.
4344
--name-status::
45Show only names and status of changed files.
4647
--color::
48Show colored diff.
4950
--no-color::
51Turn off colored diff, even when the configuration file
52gives the default to color output.
5354
--color-words::
55Show colored word diff, i.e. color words which have changed.
5657
--no-renames::
58Turn off rename detection, even when the configuration
59file gives the default to do so.
6061
--check::
62Warn if changes introduce trailing whitespace
63or an indent that uses a space before a tab.
6465
--full-index::
66Instead of the first handful characters, show full
67object name of pre- and post-image blob on the "index"
68line when generating a patch format output.
6970
--binary::
71In addition to --full-index, output "binary diff" that
72can be applied with "git apply".
7374
--abbrev[=<n>]::
75Instead of showing the full 40-byte hexadecimal object
76name in diff-raw format output and diff-tree header
77lines, show only handful hexdigits prefix. This is
78independent of --full-index option above, which controls
79the diff-patch output format. Non default number of
80digits can be specified with --abbrev=<n>.
8182
-B::
83Break complete rewrite changes into pairs of delete and create.
8485
-M::
86Detect renames.
8788
-C::
89Detect copies as well as renames.
9091
--diff-filter=[ACDMRTUXB*]::
92Select only files that are Added (`A`), Copied (`C`),
93Deleted (`D`), Modified (`M`), Renamed (`R`), have their
94type (mode) changed (`T`), are Unmerged (`U`), are
95Unknown (`X`), or have had their pairing Broken (`B`).
96Any combination of the filter characters may be used.
97When `*` (All-or-none) is added to the combination, all
98paths are selected if there is any file that matches
99other criteria in the comparison; if there is no file
100that matches other criteria, nothing is selected.
101102
--find-copies-harder::
103For performance reasons, by default, -C option finds copies only
104if the original file of the copy was modified in the same
105changeset. This flag makes the command
106inspect unmodified files as candidates for the source of
107copy. This is a very expensive operation for large
108projects, so use it with caution.
109110
-l<num>::
111-M and -C options require O(n^2) processing time where n
112is the number of potential rename/copy targets. This
113option prevents rename/copy detection from running if
114the number of rename/copy targets exceeds the specified
115number.
116117
-S<string>::
118Look for differences that contain the change in <string>.
119120
--pickaxe-all::
121When -S finds a change, show all the changes in that
122changeset, not just the files that contain the change
123in <string>.
124125
--pickaxe-regex::
126Make the <string> not a plain string but an extended POSIX
127regex to match.
128129
-O<orderfile>::
130Output the patch in the order specified in the
131<orderfile>, which has one shell glob pattern per line.
132133
-R::
134Swap two inputs; that is, show differences from index or
135on-disk file to tree contents.
136137
--text::
138Treat all files as text.
139140
-a::
141Shorthand for "--text".
142143
--ignore-space-at-eol::
144Ignore changes in white spaces at EOL.
145146
--ignore-space-change::
147Ignore changes in amount of white space. This ignores white
148space at line end, and consider all other sequences of one or
149more white space characters to be equivalent.
150151
-b::
152Shorthand for "--ignore-space-change".
153154
--ignore-all-space::
155Ignore white space when comparing lines. This ignores
156difference even if one line has white space where the other
157line has none.
158159
-w::
160Shorthand for "--ignore-all-space".
161162
--exit-code::
163Make the program exit with codes similar to diff(1).
164That is, it exits with 1 if there were differences and
1650 means no differences.
166167
For more detailed explanation on these common options, see also
168link:diffcore.html[diffcore documentation].