summaryrefslogtreecommitdiffstats
path: root/git-diff.html
diff options
context:
space:
mode:
Diffstat (limited to 'git-diff.html')
-rw-r--r--git-diff.html651
1 files changed, 650 insertions, 1 deletions
diff --git a/git-diff.html b/git-diff.html
index 327823861..9081a4d2f 100644
--- a/git-diff.html
+++ b/git-diff.html
@@ -2975,6 +2975,655 @@ Output diff in reverse.
</div>
</div>
<div class="sect1">
+<h2 id="_configuration">CONFIGURATION</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Everything below this line in this section is selectively included
+from the <a href="git-config.html">git-config(1)</a> documentation. The content is the same
+as what&#8217;s found there:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+diff.autoRefreshIndex
+</dt>
+<dd>
+<p>
+ When using <em>git diff</em> to compare with work tree
+ files, do not consider stat-only change as changed.
+ Instead, silently run <code>git update-index --refresh</code> to
+ update the cached stat information for paths whose
+ contents in the work tree match the contents in the
+ index. This option defaults to true. Note that this
+ affects only <em>git diff</em> Porcelain, and not lower level
+ <em>diff</em> commands such as <em>git diff-files</em>.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.dirstat
+</dt>
+<dd>
+<p>
+ A comma separated list of <code>--dirstat</code> parameters specifying the
+ default behavior of the <code>--dirstat</code> option to <a href="git-diff.html">git-diff(1)</a>
+ and friends. The defaults can be overridden on the command line
+ (using <code>--dirstat=&lt;param1,param2,...&gt;</code>). The fallback defaults
+ (when not changed by <code>diff.dirstat</code>) are <code>changes,noncumulative,3</code>.
+ The following parameters are available:
+</p>
+<div class="openblock">
+<div class="content">
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<code>changes</code>
+</dt>
+<dd>
+<p>
+ Compute the dirstat numbers by counting the lines that have been
+ removed from the source, or added to the destination. This ignores
+ the amount of pure code movements within a file. In other words,
+ rearranging lines in a file is not counted as much as other changes.
+ This is the default behavior when no parameter is given.
+</p>
+</dd>
+<dt class="hdlist1">
+<code>lines</code>
+</dt>
+<dd>
+<p>
+ Compute the dirstat numbers by doing the regular line-based diff
+ analysis, and summing the removed/added line counts. (For binary
+ files, count 64-byte chunks instead, since binary files have no
+ natural concept of lines). This is a more expensive <code>--dirstat</code>
+ behavior than the <code>changes</code> behavior, but it does count rearranged
+ lines within a file as much as other changes. The resulting output
+ is consistent with what you get from the other <code>--*stat</code> options.
+</p>
+</dd>
+<dt class="hdlist1">
+<code>files</code>
+</dt>
+<dd>
+<p>
+ Compute the dirstat numbers by counting the number of files changed.
+ Each changed file counts equally in the dirstat analysis. This is
+ the computationally cheapest <code>--dirstat</code> behavior, since it does
+ not have to look at the file contents at all.
+</p>
+</dd>
+<dt class="hdlist1">
+<code>cumulative</code>
+</dt>
+<dd>
+<p>
+ Count changes in a child directory for the parent directory as well.
+ Note that when using <code>cumulative</code>, the sum of the percentages
+ reported may exceed 100%. The default (non-cumulative) behavior can
+ be specified with the <code>noncumulative</code> parameter.
+</p>
+</dd>
+<dt class="hdlist1">
+&lt;limit&gt;
+</dt>
+<dd>
+<p>
+ An integer parameter specifies a cut-off percent (3% by default).
+ Directories contributing less than this percentage of the changes
+ are not shown in the output.
+</p>
+</dd>
+</dl></div>
+</div></div>
+<div class="paragraph"><p>Example: The following will count changed files, while ignoring
+directories with less than 10% of the total amount of changed files,
+and accumulating child directory counts in the parent directories:
+<code>files,10,cumulative</code>.</p></div>
+</dd>
+<dt class="hdlist1">
+diff.statGraphWidth
+</dt>
+<dd>
+<p>
+ Limit the width of the graph part in --stat output. If set, applies
+ to all commands generating --stat output except format-patch.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.context
+</dt>
+<dd>
+<p>
+ Generate diffs with &lt;n&gt; lines of context instead of the default
+ of 3. This value is overridden by the -U option.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.interHunkContext
+</dt>
+<dd>
+<p>
+ Show the context between diff hunks, up to the specified number
+ of lines, thereby fusing the hunks that are close to each other.
+ This value serves as the default for the <code>--inter-hunk-context</code>
+ command line option.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.external
+</dt>
+<dd>
+<p>
+ If this config variable is set, diff generation is not
+ performed using the internal diff machinery, but using the
+ given command. Can be overridden with the &#8216;GIT_EXTERNAL_DIFF&#8217;
+ environment variable. The command is called with parameters
+ as described under "git Diffs" in <a href="git.html">git(1)</a>. Note: if
+ you want to use an external diff program only on a subset of
+ your files, you might want to use <a href="gitattributes.html">gitattributes(5)</a> instead.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.ignoreSubmodules
+</dt>
+<dd>
+<p>
+ Sets the default value of --ignore-submodules. Note that this
+ affects only <em>git diff</em> Porcelain, and not lower level <em>diff</em>
+ commands such as <em>git diff-files</em>. <em>git checkout</em>
+ and <em>git switch</em> also honor
+ this setting when reporting uncommitted changes. Setting it to
+ <em>all</em> disables the submodule summary normally shown by <em>git commit</em>
+ and <em>git status</em> when <code>status.submoduleSummary</code> is set unless it is
+ overridden by using the --ignore-submodules command-line option.
+ The <em>git submodule</em> commands are not affected by this setting.
+ By default this is set to untracked so that any untracked
+ submodules are ignored.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.mnemonicPrefix
+</dt>
+<dd>
+<p>
+ If set, <em>git diff</em> uses a prefix pair that is different from the
+ standard "a/" and "b/" depending on what is being compared. When
+ this configuration is in effect, reverse diff output also swaps
+ the order of the prefixes:
+</p>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<code>git diff</code>
+</dt>
+<dd>
+<p>
+ compares the (i)ndex and the (w)ork tree;
+</p>
+</dd>
+<dt class="hdlist1">
+<code>git diff HEAD</code>
+</dt>
+<dd>
+<p>
+ compares a (c)ommit and the (w)ork tree;
+</p>
+</dd>
+<dt class="hdlist1">
+<code>git diff --cached</code>
+</dt>
+<dd>
+<p>
+ compares a (c)ommit and the (i)ndex;
+</p>
+</dd>
+<dt class="hdlist1">
+<code>git diff HEAD:file1 file2</code>
+</dt>
+<dd>
+<p>
+ compares an (o)bject and a (w)ork tree entity;
+</p>
+</dd>
+<dt class="hdlist1">
+<code>git diff --no-index a b</code>
+</dt>
+<dd>
+<p>
+ compares two non-git things (1) and (2).
+</p>
+</dd>
+</dl></div>
+</dd>
+<dt class="hdlist1">
+diff.noprefix
+</dt>
+<dd>
+<p>
+ If set, <em>git diff</em> does not show any source or destination prefix.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.relative
+</dt>
+<dd>
+<p>
+ If set to <em>true</em>, <em>git diff</em> does not show changes outside of the directory
+ and show pathnames relative to the current directory.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.orderFile
+</dt>
+<dd>
+<p>
+ File indicating how to order files within a diff.
+ See the <em>-O</em> option to <a href="git-diff.html">git-diff(1)</a> for details.
+ If <code>diff.orderFile</code> is a relative pathname, it is treated as
+ relative to the top of the working tree.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.renameLimit
+</dt>
+<dd>
+<p>
+ The number of files to consider in the exhaustive portion of
+ copy/rename detection; equivalent to the <em>git diff</em> option
+ <code>-l</code>. If not set, the default value is currently 1000. This
+ setting has no effect if rename detection is turned off.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.renames
+</dt>
+<dd>
+<p>
+ Whether and how Git detects renames. If set to "false",
+ rename detection is disabled. If set to "true", basic rename
+ detection is enabled. If set to "copies" or "copy", Git will
+ detect copies, as well. Defaults to true. Note that this
+ affects only <em>git diff</em> Porcelain like <a href="git-diff.html">git-diff(1)</a> and
+ <a href="git-log.html">git-log(1)</a>, and not lower level commands such as
+ <a href="git-diff-files.html">git-diff-files(1)</a>.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.suppressBlankEmpty
+</dt>
+<dd>
+<p>
+ A boolean to inhibit the standard behavior of printing a space
+ before each empty output line. Defaults to false.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.submodule
+</dt>
+<dd>
+<p>
+ Specify the format in which differences in submodules are
+ shown. The "short" format just shows the names of the commits
+ at the beginning and end of the range. The "log" format lists
+ the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code>
+ does. The "diff" format shows an inline diff of the changed
+ contents of the submodule. Defaults to "short".
+</p>
+</dd>
+<dt class="hdlist1">
+diff.wordRegex
+</dt>
+<dd>
+<p>
+ A POSIX Extended Regular Expression used to determine what is a "word"
+ when performing word-by-word difference calculations. Character
+ sequences that match the regular expression are "words", all other
+ characters are <strong>ignorable</strong> whitespace.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.&lt;driver&gt;.command
+</dt>
+<dd>
+<p>
+ The custom diff driver command. See <a href="gitattributes.html">gitattributes(5)</a>
+ for details.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.&lt;driver&gt;.xfuncname
+</dt>
+<dd>
+<p>
+ The regular expression that the diff driver should use to
+ recognize the hunk header. A built-in pattern may also be used.
+ See <a href="gitattributes.html">gitattributes(5)</a> for details.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.&lt;driver&gt;.binary
+</dt>
+<dd>
+<p>
+ Set this option to true to make the diff driver treat files as
+ binary. See <a href="gitattributes.html">gitattributes(5)</a> for details.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.&lt;driver&gt;.textconv
+</dt>
+<dd>
+<p>
+ The command that the diff driver should call to generate the
+ text-converted version of a file. The result of the
+ conversion is used to generate a human-readable diff. See
+ <a href="gitattributes.html">gitattributes(5)</a> for details.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.&lt;driver&gt;.wordRegex
+</dt>
+<dd>
+<p>
+ The regular expression that the diff driver should use to
+ split words in a line. See <a href="gitattributes.html">gitattributes(5)</a> for
+ details.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.&lt;driver&gt;.cachetextconv
+</dt>
+<dd>
+<p>
+ Set this option to true to make the diff driver cache the text
+ conversion outputs. See <a href="gitattributes.html">gitattributes(5)</a> for details.
+</p>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<code>araxis</code>
+</dt>
+<dd>
+<p>
+Use Araxis Merge (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>bc</code>
+</dt>
+<dd>
+<p>
+Use Beyond Compare (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>bc3</code>
+</dt>
+<dd>
+<p>
+Use Beyond Compare (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>bc4</code>
+</dt>
+<dd>
+<p>
+Use Beyond Compare (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>codecompare</code>
+</dt>
+<dd>
+<p>
+Use Code Compare (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>deltawalker</code>
+</dt>
+<dd>
+<p>
+Use DeltaWalker (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>diffmerge</code>
+</dt>
+<dd>
+<p>
+Use DiffMerge (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>diffuse</code>
+</dt>
+<dd>
+<p>
+Use Diffuse (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>ecmerge</code>
+</dt>
+<dd>
+<p>
+Use ECMerge (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>emerge</code>
+</dt>
+<dd>
+<p>
+Use Emacs' Emerge
+</p>
+</dd>
+<dt class="hdlist1">
+<code>examdiff</code>
+</dt>
+<dd>
+<p>
+Use ExamDiff Pro (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>guiffy</code>
+</dt>
+<dd>
+<p>
+Use Guiffy&#8217;s Diff Tool (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>gvimdiff</code>
+</dt>
+<dd>
+<p>
+Use gVim (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>kdiff3</code>
+</dt>
+<dd>
+<p>
+Use KDiff3 (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>kompare</code>
+</dt>
+<dd>
+<p>
+Use Kompare (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>meld</code>
+</dt>
+<dd>
+<p>
+Use Meld (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>nvimdiff</code>
+</dt>
+<dd>
+<p>
+Use Neovim
+</p>
+</dd>
+<dt class="hdlist1">
+<code>opendiff</code>
+</dt>
+<dd>
+<p>
+Use FileMerge (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>p4merge</code>
+</dt>
+<dd>
+<p>
+Use HelixCore P4Merge (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>smerge</code>
+</dt>
+<dd>
+<p>
+Use Sublime Merge (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>tkdiff</code>
+</dt>
+<dd>
+<p>
+Use TkDiff (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>vimdiff</code>
+</dt>
+<dd>
+<p>
+Use Vim
+</p>
+</dd>
+<dt class="hdlist1">
+<code>winmerge</code>
+</dt>
+<dd>
+<p>
+Use WinMerge (requires a graphical session)
+</p>
+</dd>
+<dt class="hdlist1">
+<code>xxdiff</code>
+</dt>
+<dd>
+<p>
+Use xxdiff (requires a graphical session)
+</p>
+</dd>
+</dl></div>
+</dd>
+<dt class="hdlist1">
+diff.indentHeuristic
+</dt>
+<dd>
+<p>
+ Set this option to <code>false</code> to disable the default heuristics
+ that shift diff hunk boundaries to make patches easier to read.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.algorithm
+</dt>
+<dd>
+<p>
+ Choose a diff algorithm. The variants are as follows:
+</p>
+<div class="openblock">
+<div class="content">
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<code>default</code>, <code>myers</code>
+</dt>
+<dd>
+<p>
+ The basic greedy diff algorithm. Currently, this is the default.
+</p>
+</dd>
+<dt class="hdlist1">
+<code>minimal</code>
+</dt>
+<dd>
+<p>
+ Spend extra time to make sure the smallest possible diff is
+ produced.
+</p>
+</dd>
+<dt class="hdlist1">
+<code>patience</code>
+</dt>
+<dd>
+<p>
+ Use "patience diff" algorithm when generating patches.
+</p>
+</dd>
+<dt class="hdlist1">
+<code>histogram</code>
+</dt>
+<dd>
+<p>
+ This algorithm extends the patience algorithm to "support
+ low-occurrence common elements".
+</p>
+</dd>
+</dl></div>
+</div></div>
+</dd>
+<dt class="hdlist1">
+diff.wsErrorHighlight
+</dt>
+<dd>
+<p>
+ Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
+ lines of the diff. Multiple values are separated by comma,
+ <code>none</code> resets previous values, <code>default</code> reset the list to
+ <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. The
+ whitespace errors are colored with <code>color.diff.whitespace</code>.
+ The command line option <code>--ws-error-highlight=&lt;kind&gt;</code>
+ overrides this setting.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.colorMoved
+</dt>
+<dd>
+<p>
+ If set to either a valid <code>&lt;mode&gt;</code> or a true value, moved lines
+ in a diff are colored differently, for details of valid modes
+ see <em>--color-moved</em> in <a href="git-diff.html">git-diff(1)</a>. If simply set to
+ true the default color mode will be used. When set to false,
+ moved lines are not colored.
+</p>
+</dd>
+<dt class="hdlist1">
+diff.colorMovedWS
+</dt>
+<dd>
+<p>
+ When moved lines are colored using e.g. the <code>diff.colorMoved</code> setting,
+ this option controls the <code>&lt;mode&gt;</code> how spaces are treated
+ for details of valid modes see <em>--color-moved-ws</em> in <a href="git-diff.html">git-diff(1)</a>.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect1">
<h2 id="_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph"><p>diff(1),
@@ -2997,7 +3646,7 @@ Output diff in reverse.
<div id="footer">
<div id="footer-text">
Last updated
- 2021-08-04 00:06:05 PDT
+ 2022-09-14 13:23:11 PDT
</div>
</div>
</body>