Git fork
1`diff.autoRefreshIndex`::
2 When using `git diff` to compare with work tree
3 files, do not consider stat-only changes as changed.
4 Instead, silently run `git update-index --refresh` to
5 update the cached stat information for paths whose
6 contents in the work tree match the contents in the
7 index. This option defaults to `true`. Note that this
8 affects only `git diff` Porcelain, and not lower level
9 `diff` commands such as `git diff-files`.
10
11`diff.dirstat`::
12ifdef::git-diff[]
13 A comma separated list of `--dirstat` parameters specifying the
14 default behavior of the `--dirstat` option to `git diff` and friends.
15endif::git-diff[]
16ifndef::git-diff[]
17 A comma separated list of `--dirstat` parameters specifying the
18 default behavior of the `--dirstat` option to linkgit:git-diff[1]
19 and friends.
20endif::git-diff[]
21 The defaults can be overridden on the command line
22 (using `--dirstat=<param>,...`). The fallback defaults
23 (when not changed by `diff.dirstat`) are `changes,noncumulative,3`.
24 The following parameters are available:
25+
26--
27`changes`;;
28 Compute the dirstat numbers by counting the lines that have been
29 removed from the source, or added to the destination. This ignores
30 the amount of pure code movements within a file. In other words,
31 rearranging lines in a file is not counted as much as other changes.
32 This is the default behavior when no parameter is given.
33`lines`;;
34 Compute the dirstat numbers by doing the regular line-based diff
35 analysis, and summing the removed/added line counts. (For binary
36 files, count 64-byte chunks instead, since binary files have no
37 natural concept of lines). This is a more expensive `--dirstat`
38 behavior than the `changes` behavior, but it does count rearranged
39 lines within a file as much as other changes. The resulting output
40 is consistent with what you get from the other `--*stat` options.
41`files`;;
42 Compute the dirstat numbers by counting the number of files changed.
43 Each changed file counts equally in the dirstat analysis. This is
44 the computationally cheapest `--dirstat` behavior, since it does
45 not have to look at the file contents at all.
46`cumulative`;;
47 Count changes in a child directory for the parent directory as well.
48 Note that when using `cumulative`, the sum of the percentages
49 reported may exceed 100%. The default (non-cumulative) behavior can
50 be specified with the `noncumulative` parameter.
51_<limit>_;;
52 An integer parameter specifies a cut-off percent (3% by default).
53 Directories contributing less than this percentage of the changes
54 are not shown in the output.
55--
56+
57Example: The following will count changed files, while ignoring
58directories with less than 10% of the total amount of changed files,
59and accumulating child directory counts in the parent directories:
60`files,10,cumulative`.
61
62`diff.statNameWidth`::
63 Limit the width of the filename part in `--stat` output. If set, applies
64 to all commands generating `--stat` output except `format-patch`.
65
66`diff.statGraphWidth`::
67 Limit the width of the graph part in `--stat` output. If set, applies
68 to all commands generating `--stat` output except `format-patch`.
69
70`diff.context`::
71 Generate diffs with _<n>_ lines of context instead of the default
72 of 3. This value is overridden by the `-U` option.
73
74`diff.interHunkContext`::
75 Show the context between diff hunks, up to the specified number
76 of lines, thereby fusing the hunks that are close to each other.
77 This value serves as the default for the `--inter-hunk-context`
78 command line option.
79
80`diff.external`::
81 If this config variable is set, diff generation is not
82 performed using the internal diff machinery, but using the
83 given command. Can be overridden with the `GIT_EXTERNAL_DIFF`
84 environment variable. The command is called with parameters
85 as described under "git Diffs" in linkgit:git[1]. Note: if
86 you want to use an external diff program only on a subset of
87 your files, you might want to use linkgit:gitattributes[5] instead.
88
89`diff.trustExitCode`::
90 If this boolean value is set to `true` then the
91 `diff.external` command is expected to return exit code
92 0 if it considers the input files to be equal or 1 if it
93 considers them to be different, like `diff`(1).
94 If it is set to `false`, which is the default, then the command
95 is expected to return exit code `0` regardless of equality.
96 Any other exit code causes Git to report a fatal error.
97
98`diff.ignoreSubmodules`::
99 Sets the default value of `--ignore-submodules`. Note that this
100 affects only `git diff` Porcelain, and not lower level `diff`
101 commands such as `git diff-files`. `git checkout`
102 and `git switch` also honor
103 this setting when reporting uncommitted changes. Setting it to
104 `all` disables the submodule summary normally shown by `git commit`
105 and `git status` when `status.submoduleSummary` is set unless it is
106 overridden by using the `--ignore-submodules` command-line option.
107 The `git submodule` commands are not affected by this setting.
108 By default this is set to untracked so that any untracked
109 submodules are ignored.
110
111`diff.mnemonicPrefix`::
112 If set, `git diff` uses a prefix pair that is different from the
113 standard `a/` and `b/` depending on what is being compared. When
114 this configuration is in effect, reverse diff output also swaps
115 the order of the prefixes:
116`git diff`;;
117 compares the (i)ndex and the (w)ork tree;
118`git diff HEAD`;;
119 compares a (c)ommit and the (w)ork tree;
120`git diff --cached`;;
121 compares a (c)ommit and the (i)ndex;
122`git diff HEAD:<file1> <file2>`;;
123 compares an (o)bject and a (w)ork tree entity;
124`git diff --no-index <a> <b>`;;
125 compares two non-git things _<a>_ and _<b>_.
126
127`diff.noPrefix`::
128 If set, `git diff` does not show any source or destination prefix.
129
130`diff.srcPrefix`::
131 If set, `git diff` uses this source prefix. Defaults to `a/`.
132
133`diff.dstPrefix`::
134 If set, `git diff` uses this destination prefix. Defaults to `b/`.
135
136`diff.relative`::
137 If set to `true`, `git diff` does not show changes outside of the directory
138 and show pathnames relative to the current directory.
139
140`diff.orderFile`::
141 File indicating how to order files within a diff.
142ifdef::git-diff[]
143 See the `-O` option for details.
144endif::git-diff[]
145ifndef::git-diff[]
146 See the `-O` option to linkgit:git-diff[1] for details.
147endif::git-diff[]
148 If `diff.orderFile` is a relative pathname, it is treated as
149 relative to the top of the working tree.
150
151`diff.renameLimit`::
152 The number of files to consider in the exhaustive portion of
153 copy/rename detection; equivalent to the `git diff` option
154 `-l`. If not set, the default value is currently 1000. This
155 setting has no effect if rename detection is turned off.
156
157`diff.renames`::
158 Whether and how Git detects renames. If set to `false`,
159 rename detection is disabled. If set to `true`, basic rename
160 detection is enabled. If set to `copies` or `copy`, Git will
161 detect copies, as well. Defaults to `true`. Note that this
162 affects only `git diff` Porcelain like linkgit:git-diff[1] and
163 linkgit:git-log[1], and not lower level commands such as
164 linkgit:git-diff-files[1].
165
166`diff.suppressBlankEmpty`::
167 A boolean to inhibit the standard behavior of printing a space
168 before each empty output line. Defaults to `false`.
169
170`diff.submodule`::
171 Specify the format in which differences in submodules are
172 shown. The `short` format just shows the names of the commits
173 at the beginning and end of the range. The `log` format lists
174 the commits in the range like linkgit:git-submodule[1] `summary`
175 does. The `diff` format shows an inline diff of the changed
176 contents of the submodule. Defaults to `short`.
177
178`diff.wordRegex`::
179 A POSIX Extended Regular Expression used to determine what is a "word"
180 when performing word-by-word difference calculations. Character
181 sequences that match the regular expression are "words", all other
182 characters are *ignorable* whitespace.
183
184`diff.<driver>.command`::
185 The custom diff driver command. See linkgit:gitattributes[5]
186 for details.
187
188`diff.<driver>.trustExitCode`::
189 If this boolean value is set to `true` then the
190 `diff.<driver>.command` command is expected to return exit code
191 0 if it considers the input files to be equal or 1 if it
192 considers them to be different, like `diff`(1).
193 If it is set to `false`, which is the default, then the command
194 is expected to return exit code 0 regardless of equality.
195 Any other exit code causes Git to report a fatal error.
196
197`diff.<driver>.xfuncname`::
198 The regular expression that the diff driver should use to
199 recognize the hunk header. A built-in pattern may also be used.
200 See linkgit:gitattributes[5] for details.
201
202`diff.<driver>.binary`::
203 Set this option to `true` to make the diff driver treat files as
204 binary. See linkgit:gitattributes[5] for details.
205
206`diff.<driver>.textconv`::
207 The command that the diff driver should call to generate the
208 text-converted version of a file. The result of the
209 conversion is used to generate a human-readable diff. See
210 linkgit:gitattributes[5] for details.
211
212`diff.<driver>.wordRegex`::
213 The regular expression that the diff driver should use to
214 split words in a line. See linkgit:gitattributes[5] for
215 details.
216
217`diff.<driver>.cachetextconv`::
218 Set this option to `true` to make the diff driver cache the text
219 conversion outputs. See linkgit:gitattributes[5] for details.
220
221`diff.indentHeuristic`::
222 Set this option to `false` to disable the default heuristics
223 that shift diff hunk boundaries to make patches easier to read.
224
225`diff.algorithm`::
226 Choose a diff algorithm. The variants are as follows:
227+
228--
229`default`;;
230`myers`;;
231 The basic greedy diff algorithm. Currently, this is the default.
232`minimal`;;
233 Spend extra time to make sure the smallest possible diff is
234 produced.
235`patience`;;
236 Use "patience diff" algorithm when generating patches.
237`histogram`;;
238 This algorithm extends the patience algorithm to "support
239 low-occurrence common elements".
240--
241+
242
243`diff.wsErrorHighlight`::
244 Highlight whitespace errors in the `context`, `old` or `new`
245 lines of the diff. Multiple values are separated by comma,
246 `none` resets previous values, `default` reset the list to
247 `new` and `all` is a shorthand for `old,new,context`. The
248 whitespace errors are colored with `color.diff.whitespace`.
249 The command line option `--ws-error-highlight=<kind>`
250 overrides this setting.
251
252`diff.colorMoved`::
253 If set to either a valid _<mode>_ or a `true` value, moved lines
254 in a diff are colored differently.
255ifdef::git-diff[]
256 For details of valid modes see `--color-moved`.
257endif::git-diff[]
258ifndef::git-diff[]
259 For details of valid modes see `--color-moved` in linkgit:git-diff[1].
260endif::git-diff[]
261 If simply set to `true` the default color mode will be used. When
262 set to `false`, moved lines are not colored.
263
264`diff.colorMovedWS`::
265 When moved lines are colored using e.g. the `diff.colorMoved` setting,
266 this option controls the mode how spaces are treated.
267 For details of valid modes see `--color-moved-ws` in linkgit:git-diff[1].