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