blob: 7788d4fa4a1209cbed564a20f882f0946ba400cf [file] [log] [blame]
Junio C Hamanoff979792007-11-16 10:11:301// Please don't remove this comment as asciidoc behaves badly when
2// the first non-empty line is ifdef/ifndef. The symptom is that
3// without this comment the <git-diff-core> attribute conditionally
4// defined below ends up being defined unconditionally.
5// Last checked with asciidoc 7.0.2.
6
7ifndef::git-format-patch[]
8ifndef::git-diff[]
Junio C Hamano00b8b632007-12-07 09:50:499ifndef::git-log[]
Junio C Hamanoff979792007-11-16 10:11:3010:git-diff-core: 1
Junio C Hamano00b8b632007-12-07 09:50:4911endif::git-log[]
Junio C Hamanoff979792007-11-16 10:11:3012endif::git-diff[]
13endif::git-format-patch[]
14
15ifdef::git-format-patch[]
Junio C Hamano1a4e8412005-12-27 08:17:2316-p::
Junio C Hamanoff979792007-11-16 10:11:3017Generate patches without diffstat.
18endif::git-format-patch[]
19
20ifndef::git-format-patch[]
21-p::
22Generate patch (see section on generating patches).
23{git-diff? This is the default.}
24endif::git-format-patch[]
Junio C Hamano1a4e8412005-12-27 08:17:2325
26-u::
27Synonym for "-p".
28
Junio C Hamano69361562007-07-26 02:14:3429-U<n>::
30Shorthand for "--unified=<n>".
31
32--unified=<n>::
33Generate diffs with <n> lines of context instead of
34the usual three. Implies "-p".
35
Junio C Hamano9ae1a062006-07-10 08:12:3436--raw::
37Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:3038{git-diff-core? This is the default.}
Junio C Hamano9ae1a062006-07-10 08:12:3439
Junio C Hamano54559c82006-04-13 07:45:1240--patch-with-raw::
Junio C Hamano9ae1a062006-07-10 08:12:3441Synonym for "-p --raw".
Junio C Hamano54559c82006-04-13 07:45:1242
Junio C Hamano4a9a76a2006-10-01 05:40:2943--stat[=width[,name-width]]::
44Generate a diffstat. You can override the default
45output width for 80-column terminal by "--stat=width".
46The width of the filename part can be controlled by
47giving another width to it separated by a comma.
Junio C Hamanoba7c8d82006-04-15 06:17:4248
Junio C Hamanofbe00522006-10-19 05:58:4849--numstat::
50Similar to \--stat, but shows number of added and
51deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:4352abbreviation, to make it more machine friendly. For
53binary files, outputs two `-` instead of saying
54`0 0`.
Junio C Hamanofbe00522006-10-19 05:58:4855
Junio C Hamano7d23f5e2006-12-16 07:44:0456--shortstat::
57Output only the last line of the --stat format containing total
58number of modified files, as well as number of added and deleted
59lines.
60
Junio C Hamano6a45be92008-04-22 08:19:0361--dirstat[=limit]::
Junio C Hamanoa2f46622008-09-03 05:20:3162Output the distribution of relative amount of changes (number of lines added or
63removed) for each sub-directory. Directories with changes below
64a cut-off percent (3% by default) are not shown. The cut-off percent
65can be set with "--dirstat=limit". Changes in a child directory is not
66counted for the parent directory, unless "--cumulative" is used.
Junio C Hamano6a45be92008-04-22 08:19:0367
Junio C Hamanoa476efa2008-10-10 15:31:4268--dirstat-by-file[=limit]::
69Same as --dirstat, but counts changed files instead of lines.
70
Junio C Hamano6959c6c2006-05-17 10:34:1171--summary::
72Output a condensed summary of extended header information
73such as creations, renames and mode changes.
74
Junio C Hamanod1308c92006-04-16 11:01:0975--patch-with-stat::
Junio C Hamano9ae1a062006-07-10 08:12:3476Synonym for "-p --stat".
Junio C Hamanoff979792007-11-16 10:11:3077{git-format-patch? This is the default.}
Junio C Hamanod1308c92006-04-16 11:01:0978
Junio C Hamano1a4e8412005-12-27 08:17:2379-z::
Junio C Hamanob968dbb2007-07-27 07:26:4080NUL-line termination on output. This affects the --raw
81output field terminator. Also output from commands such
82as "git-log" will be delimited with NUL between commits.
Junio C Hamano1a4e8412005-12-27 08:17:2383
84--name-only::
85Show only names of changed files.
86
87--name-status::
Junio C Hamanoa9aee782008-04-23 16:09:2088Show only names and status of changed files. See the description
89of the `--diff-filter` option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:2390
Junio C Hamano9ae1a062006-07-10 08:12:3491--color::
92Show colored diff.
93
94--no-color::
95Turn off colored diff, even when the configuration file
96gives the default to color output.
97
Junio C Hamano85e45fa2006-08-13 07:47:4198--color-words::
99Show colored word diff, i.e. color words which have changed.
100
Junio C Hamano9ae1a062006-07-10 08:12:34101--no-renames::
102Turn off rename detection, even when the configuration
103file gives the default to do so.
104
Junio C Hamanoa890c4f2007-01-28 10:29:21105--check::
106Warn if changes introduce trailing whitespace
Junio C Hamano3dac5042007-12-15 08:40:54107or an indent that uses a space before a tab. Exits with
108non-zero status if problems are found. Not compatible with
109--exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:21110
Junio C Hamano1a4e8412005-12-27 08:17:23111--full-index::
Junio C Hamano5cf43ca2008-08-20 09:14:14112Instead of the first handful of characters, show the full
113pre- and post-image blob object names on the "index"
114line when generating patch format output.
Junio C Hamano9ae1a062006-07-10 08:12:34115
116--binary::
117In addition to --full-index, output "binary diff" that
118can be applied with "git apply".
Junio C Hamano1a4e8412005-12-27 08:17:23119
120--abbrev[=<n>]::
121Instead of showing the full 40-byte hexadecimal object
122name in diff-raw format output and diff-tree header
Junio C Hamano235a91e2006-01-07 01:13:58123lines, show only handful hexdigits prefix. This is
Junio C Hamano1a4e8412005-12-27 08:17:23124independent of --full-index option above, which controls
125the diff-patch output format. Non default number of
126digits can be specified with --abbrev=<n>.
127
128-B::
129Break complete rewrite changes into pairs of delete and create.
130
131-M::
132Detect renames.
133
134-C::
Junio C Hamano16f98872007-06-12 16:09:14135Detect copies as well as renames. See also `--find-copies-harder`.
Junio C Hamano1a4e8412005-12-27 08:17:23136
Junio C Hamano6ec31b92006-02-10 05:52:01137--diff-filter=[ACDMRTUXB*]::
138Select only files that are Added (`A`), Copied (`C`),
139Deleted (`D`), Modified (`M`), Renamed (`R`), have their
140type (mode) changed (`T`), are Unmerged (`U`), are
141Unknown (`X`), or have had their pairing Broken (`B`).
142Any combination of the filter characters may be used.
143When `*` (All-or-none) is added to the combination, all
144paths are selected if there is any file that matches
145other criteria in the comparison; if there is no file
146that matches other criteria, nothing is selected.
147
Junio C Hamano1a4e8412005-12-27 08:17:23148--find-copies-harder::
Junio C Hamano16f98872007-06-12 16:09:14149For performance reasons, by default, `-C` option finds copies only
Junio C Hamanoa77a5132007-06-08 16:13:44150if the original file of the copy was modified in the same
Junio C Hamano1a4e8412005-12-27 08:17:23151changeset. This flag makes the command
152inspect unmodified files as candidates for the source of
153copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:14154projects, so use it with caution. Giving more than one
155`-C` option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:23156
157-l<num>::
158-M and -C options require O(n^2) processing time where n
159is the number of potential rename/copy targets. This
160option prevents rename/copy detection from running if
161the number of rename/copy targets exceeds the specified
162number.
163
164-S<string>::
165Look for differences that contain the change in <string>.
166
167--pickaxe-all::
168When -S finds a change, show all the changes in that
169changeset, not just the files that contain the change
170in <string>.
171
Junio C Hamanobfe9e752006-04-05 21:43:28172--pickaxe-regex::
173Make the <string> not a plain string but an extended POSIX
174regex to match.
175
Junio C Hamano1a4e8412005-12-27 08:17:23176-O<orderfile>::
177Output the patch in the order specified in the
178<orderfile>, which has one shell glob pattern per line.
179
180-R::
181Swap two inputs; that is, show differences from index or
182on-disk file to tree contents.
183
Junio C Hamano24bc09a2008-02-28 00:27:44184--relative[=<path>]::
185When run from a subdirectory of the project, it can be
186told to exclude changes outside the directory and show
187pathnames relative to it with this option. When you are
188not in a subdirectory (e.g. in a bare repository), you
189can name which subdirectory to make the output relative
190to by giving a <path> as an argument.
191
Junio C Hamanoc26f5482006-07-09 09:38:14192--text::
193Treat all files as text.
194
195-a::
196Shorthand for "--text".
197
Junio C Hamanofd468962007-02-14 23:45:04198--ignore-space-at-eol::
Junio C Hamano3a702342007-12-12 21:34:02199Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:04200
Junio C Hamanod9c2d2f2006-12-06 08:59:07201--ignore-space-change::
Junio C Hamano3a702342007-12-12 21:34:02202Ignore changes in amount of whitespace. This ignores whitespace
203at line end, and considers all other sequences of one or
204more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:07205
206-b::
207Shorthand for "--ignore-space-change".
208
209--ignore-all-space::
Junio C Hamano3a702342007-12-12 21:34:02210Ignore whitespace when comparing lines. This ignores
211differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:07212line has none.
213
214-w::
215Shorthand for "--ignore-all-space".
216
Junio C Hamano48fd2f62007-03-19 02:02:30217--exit-code::
218Make the program exit with codes similar to diff(1).
219That is, it exits with 1 if there were differences and
2200 means no differences.
221
Junio C Hamano35e57552007-03-25 07:54:35222--quiet::
223Disable all output of the program. Implies --exit-code.
224
Junio C Hamanobb0f4042007-07-04 06:41:40225--ext-diff::
226Allow an external diff helper to be executed. If you set an
Junio C Hamano35738e82008-01-07 07:55:46227external diff driver with linkgit:gitattributes[5], you need
228to use this option with linkgit:git-log[1] and friends.
Junio C Hamanobb0f4042007-07-04 06:41:40229
230--no-ext-diff::
231Disallow external diff drivers.
232
Junio C Hamanodfccbb02008-05-26 01:16:14233--ignore-submodules::
234Ignore changes to submodules in the diff generation.
235
Junio C Hamanoe27cbd22007-12-21 17:57:33236--src-prefix=<prefix>::
237Show the given source prefix instead of "a/".
238
239--dst-prefix=<prefix>::
240Show the given destination prefix instead of "b/".
241
242--no-prefix::
243Do not show any source or destination prefix.
244
Junio C Hamano1a4e8412005-12-27 08:17:23245For more detailed explanation on these common options, see also
Junio C Hamanofce7c7e2008-07-02 03:06:38246linkgit:gitdiffcore[7].