CINXE.COM
Git - git-difftool Documentation
<!DOCTYPE html> <html lang="en"> <head> <meta charset='utf-8'> <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Git - git-difftool Documentation</title> <link href="/favicon.ico" rel='shortcut icon' type='image/x-icon'> <link rel="stylesheet" href="/application.min.css"> <script src="/js/modernizr.js"></script> <script src="/js/modernize.js"></script> </head> <body id="documentation"> <div class="inner"> <header> <a href="/"><img src="/images/logo@2x.png" width="110" height="46" alt="Git" /></a> <span id="tagline"></span> <script type="text/javascript"> const taglines = [ "fast-version-control", "everything-is-local", "distributed-even-if-your-workflow-isnt", "local-branching-on-the-cheap", "distributed-is-the-new-centralized" ]; var tagline = taglines[Math.floor(Math.random() * taglines.length)]; document.getElementById('tagline').innerHTML = '--' + tagline; </script> <form id="search" action="/search/results"> <input id="search-text" name="search" placeholder="Type / to search entire site…" autocomplete="off" type="text" /> </form> <div id="search-results"></div> </header> </div> <div class="inner"> <div id="content-wrapper"> <div tabindex="1" class="sidebar-btn"></div> <aside class="sidebar" id="sidebar"> <nav> <ul> <li> <a href="/about">About</a> <ul> </ul> </li> <li> <a href="/doc" class="active">Documentation</a> <ul class="expanded"> <li> <a href="/docs" class="active">Reference</a> </li> <li> <a href="/book">Book</a> </li> <li> <a href="/videos">Videos</a> </li> <li> <a href="/doc/ext">External Links</a> </li> </ul> </li> <li> <a href="/downloads">Downloads</a> <ul > <li> <a href="/downloads/guis">GUI Clients</a> </li> <li> <a href="/downloads/logos">Logos</a> </li> </ul> </li> <li> <a href="/community">Community</a> </li> </ul> </nav> </aside> <div id="content"> <div id='reference-version'> <a class="dropdown-trigger" id="reference-languages-trigger" data-panel-id="l10n-versions-dropdown" href="#"> English ▾</a> <div class='dropdown-panel right' id='l10n-versions-dropdown'> <header>Localized versions of <strong>git-difftool</strong> manual</header> <ol class='reference-previous-versions'> <li> <a href="/docs/git-difftool"><span class="version">English</span> </a> </li> <li> <a href="/docs/git-difftool/fr"><span class="version">Français</span> </a> </li> <li> <a href="/docs/git-difftool/pt_BR"><span class="version">Português (Brasil)</span> </a> </li> <li> <a href="/docs/git-difftool/zh_HANS-CN"><span class="version">简体中文</span> </a> </li> </ol> <footer> Want to read in your language or fix typos?<br/> <a href="https://github.com/jnavila/git-manpages-l10n">You can help translate this page</a>. </footer> </div> <a class="dropdown-trigger" id="reference-topics-trigger" data-panel-id="topics-dropdown" href="#">Topics ▾</a> <div class='dropdown-panel right' id='topics-dropdown'> <div class='three-column'> <div class='column-left'> <h3 class='setup'>Setup and Config</h3> <ul class='unstyled'> <li> <a href="/docs/git"> git </a> </li> <li> <a href="/docs/git-config"> config </a> </li> <li> <a href="/docs/git-help"> help </a> </li> <li> <a href="/docs/git-bugreport"> bugreport </a> </li> <li> <a href="/doc/credential-helpers"> Credential helpers </a> </li> </ul> <h3 class='projects'>Getting and Creating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-init"> init </a> </li> <li> <a href="/docs/git-clone"> clone </a> </li> </ul> <h3 class='snapshotting'>Basic Snapshotting</h3> <ul class='unstyled'> <li> <a href="/docs/git-add"> add </a> </li> <li> <a href="/docs/git-status"> status </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-commit"> commit </a> </li> <li> <a href="/docs/git-notes"> notes </a> </li> <li> <a href="/docs/git-restore"> restore </a> </li> <li> <a href="/docs/git-reset"> reset </a> </li> <li> <a href="/docs/git-rm"> rm </a> </li> <li> <a href="/docs/git-mv"> mv </a> </li> </ul> <h3 class='branching'>Branching and Merging</h3> <ul class='unstyled'> <li> <a href="/docs/git-branch"> branch </a> </li> <li> <a href="/docs/git-checkout"> checkout </a> </li> <li> <a href="/docs/git-switch"> switch </a> </li> <li> <a href="/docs/git-merge"> merge </a> </li> <li> <a href="/docs/git-mergetool"> mergetool </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-stash"> stash </a> </li> <li> <a href="/docs/git-tag"> tag </a> </li> <li> <a href="/docs/git-worktree"> worktree </a> </li> </ul> <h3 class='sharing'>Sharing and Updating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-fetch"> fetch </a> </li> <li> <a href="/docs/git-pull"> pull </a> </li> <li> <a href="/docs/git-push"> push </a> </li> <li> <a href="/docs/git-remote"> remote </a> </li> <li> <a href="/docs/git-submodule"> submodule </a> </li> </ul> </div> <div class='column-middle'> <h3 class='inspection'>Inspection and Comparison</h3> <ul class='unstyled'> <li> <a href="/docs/git-show"> show </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-difftool"> difftool </a> </li> <li> <a href="/docs/git-range-diff"> range-diff </a> </li> <li> <a href="/docs/git-shortlog"> shortlog </a> </li> <li> <a href="/docs/git-describe"> describe </a> </li> </ul> <h3 class='patching'>Patching</h3> <ul class='unstyled'> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-cherry-pick"> cherry-pick </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-rebase"> rebase </a> </li> <li> <a href="/docs/git-revert"> revert </a> </li> </ul> <h3 class='debugging'>Debugging</h3> <ul class='unstyled'> <li> <a href="/docs/git-bisect"> bisect </a> </li> <li> <a href="/docs/git-blame"> blame </a> </li> <li> <a href="/docs/git-grep"> grep </a> </li> </ul> <h3 class='email'>Email</h3> <ul class='unstyled'> <li> <a href="/docs/git-am"> am </a> </li> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-format-patch"> format-patch </a> </li> <li> <a href="/docs/git-send-email"> send-email </a> </li> <li> <a href="/docs/git-request-pull"> request-pull </a> </li> </ul> <h3 class='external'>External Systems</h3> <ul class='unstyled'> <li> <a href="/docs/git-svn"> svn </a> </li> <li> <a href="/docs/git-fast-import"> fast-import </a> </li> </ul> <h3 class='server-admin'>Server Admin</h3> <ul class='unstyled'> <li> <a href="/docs/git-daemon"> daemon </a> </li> <li> <a href="/docs/git-update-server-info"> update-server-info </a> </li> </ul> </div> <div class='column-right'> <h3 class='guides'>Guides</h3> <ul class='unstyled'> <li> <a href="/docs/gitattributes"> gitattributes </a> </li> <li> <a href="/docs/gitcli"> Command-line interface conventions </a> </li> <li> <a href="/docs/giteveryday"> Everyday Git </a> </li> <li> <a href="/docs/gitfaq"> Frequently Asked Questions (FAQ) </a> </li> <li> <a href="/docs/gitglossary"> Glossary </a> </li> <li> <a href="/docs/githooks"> Hooks </a> </li> <li> <a href="/docs/gitignore"> gitignore </a> </li> <li> <a href="/docs/gitmodules"> gitmodules </a> </li> <li> <a href="/docs/gitrevisions"> Revisions </a> </li> <li> <a href="/docs/gitsubmodules"> Submodules </a> </li> <li> <a href="/docs/gittutorial"> Tutorial </a> </li> <li> <a href="/docs/gitworkflows"> Workflows </a> </li> <li> <a href="/docs/git#_guides"> All guides... </a> </li> </ul> <h3 class='admin'>Administration</h3> <ul class='unstyled'> <li> <a href="/docs/git-clean"> clean </a> </li> <li> <a href="/docs/git-gc"> gc </a> </li> <li> <a href="/docs/git-fsck"> fsck </a> </li> <li> <a href="/docs/git-reflog"> reflog </a> </li> <li> <a href="/docs/git-filter-branch"> filter-branch </a> </li> <li> <a href="/docs/git-instaweb"> instaweb </a> </li> <li> <a href="/docs/git-archive"> archive </a> </li> <li> <a href="/docs/git-bundle"> bundle </a> </li> </ul> <h3 class='plumbing'>Plumbing Commands</h3> <ul class='unstyled'> <li> <a href="/docs/git-cat-file"> cat-file </a> </li> <li> <a href="/docs/git-check-ignore"> check-ignore </a> </li> <li> <a href="/docs/git-checkout-index"> checkout-index </a> </li> <li> <a href="/docs/git-commit-tree"> commit-tree </a> </li> <li> <a href="/docs/git-count-objects"> count-objects </a> </li> <li> <a href="/docs/git-diff-index"> diff-index </a> </li> <li> <a href="/docs/git-for-each-ref"> for-each-ref </a> </li> <li> <a href="/docs/git-hash-object"> hash-object </a> </li> <li> <a href="/docs/git-ls-files"> ls-files </a> </li> <li> <a href="/docs/git-ls-tree"> ls-tree </a> </li> <li> <a href="/docs/git-merge-base"> merge-base </a> </li> <li> <a href="/docs/git-read-tree"> read-tree </a> </li> <li> <a href="/docs/git-rev-list"> rev-list </a> </li> <li> <a href="/docs/git-rev-parse"> rev-parse </a> </li> <li> <a href="/docs/git-show-ref"> show-ref </a> </li> <li> <a href="/docs/git-symbolic-ref"> symbolic-ref </a> </li> <li> <a href="/docs/git-update-index"> update-index </a> </li> <li> <a href="/docs/git-update-ref"> update-ref </a> </li> <li> <a href="/docs/git-verify-pack"> verify-pack </a> </li> <li> <a href="/docs/git-write-tree"> write-tree </a> </li> </ul> </div> </div> </div> <a class="dropdown-trigger" id="reference-versions-trigger" data-panel-id="previous-versions-dropdown" href="#"> Latest version ▾ </a> <span class="light d-flex">git-difftool last updated in 2.45.0</span> <div class='dropdown-panel left' id='previous-versions-dropdown'> <header>Changes in the <strong>git-difftool</strong> manual</header> <ol class='reference-previous-versions'> <li class="no-change"><span>2.45.1 → 2.47.0 no changes</span></li> <li class="no-change"><span>2.45.0 no changes</span></li> <li class="no-change"><span>2.44.1 → 2.44.2 no changes</span></li> <li> <a href="/docs/git-difftool/2.44.0"><span class="version">2.44.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">02/23/24</em> </a> </li> <li class="no-change"><span>2.43.1 → 2.43.5 no changes</span></li> <li> <a href="/docs/git-difftool/2.43.0"><span class="version">2.43.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">11/20/23</em> </a> </li> <li class="no-change"><span>2.41.1 → 2.42.3 no changes</span></li> <li> <a href="/docs/git-difftool/2.41.0"><span class="version">2.41.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">06/01/23</em> </a> </li> <li class="no-change"><span>2.38.1 → 2.40.3 no changes</span></li> <li> <a href="/docs/git-difftool/2.38.0"><span class="version">2.38.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">10/02/22</em> </a> </li> <li class="no-change"><span>2.31.1 → 2.37.7 no changes</span></li> <li> <a href="/docs/git-difftool/2.31.0"><span class="version">2.31.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">03/15/21</em> </a> </li> <li class="no-change"><span>2.22.1 → 2.30.9 no changes</span></li> <li> <a href="/docs/git-difftool/2.22.0"><span class="version">2.22.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">06/07/19</em> </a> </li> <li class="no-change"><span>2.13.7 → 2.21.4 no changes</span></li> <li> <a href="/docs/git-difftool/2.12.5"><span class="version">2.12.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">09/22/17</em> </a> </li> <li class="no-change"><span>2.10.5 → 2.11.4 no changes</span></li> <li> <a href="/docs/git-difftool/2.9.5"><span class="version">2.9.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">07/30/17</em> </a> </li> <li class="no-change"><span>2.3.10 → 2.8.6 no changes</span></li> <li> <a href="/docs/git-difftool/2.2.3"><span class="version">2.2.3</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">09/04/15</em> </a> </li> <li class="no-change"><span>2.1.4 no changes</span></li> <li> <a href="/docs/git-difftool/2.0.5"><span class="version">2.0.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">12/17/14</em> </a> </li> <li> </li> </ol> <footer> <p>Check your version of git by running</p> <code class="command">git --version</code> </footer> </div> </div> <div id="main" data-pagefind-filter="category:reference" data-pagefind-meta="category:Reference" data-pagefind-weight="0.05" data-pagefind-body> <div class="sect1"> <h2 id="_name"><a class="anchor" href="#_name"></a>NAME</h2> <div class="sectionbody"> <div class="paragraph"> <p>git-difftool - Show changes using common diff tools</p> </div> </div> </div> <div class="sect1"> <h2 id="_synopsis"><a class="anchor" href="#_synopsis"></a>SYNOPSIS</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content"><em>git difftool</em> [<options>] [<commit> [<commit>]] [--] [<path>…​]</pre> </div> </div> </div> <div class="sect1"> <h2 id="_description"><a class="anchor" href="#_description"></a>DESCRIPTION</h2> <div class="sectionbody"> <div class="paragraph"> <p><em>git difftool</em> is a Git command that allows you to compare and edit files between revisions using common diff tools. <em>git difftool</em> is a frontend to <em>git diff</em> and accepts the same options and arguments. See <a href='/docs/git-diff'>git-diff[1]</a>.</p> </div> </div> </div> <div class="sect1"> <h2 id="_options"><a class="anchor" href="#_options"></a>OPTIONS</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-difftool.txt--d"> <a class="anchor" href="#Documentation/git-difftool.txt--d"></a>-d </dt> <dt class="hdlist1" id="Documentation/git-difftool.txt---dir-diff"> <a class="anchor" href="#Documentation/git-difftool.txt---dir-diff"></a>--dir-diff </dt> <dd> <p>Copy the modified files to a temporary location and perform a directory diff on them. This mode never prompts before launching the diff tool.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt--y"> <a class="anchor" href="#Documentation/git-difftool.txt--y"></a>-y </dt> <dt class="hdlist1" id="Documentation/git-difftool.txt---no-prompt"> <a class="anchor" href="#Documentation/git-difftool.txt---no-prompt"></a>--no-prompt </dt> <dd> <p>Do not prompt before launching a diff tool.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt---prompt"> <a class="anchor" href="#Documentation/git-difftool.txt---prompt"></a>--prompt </dt> <dd> <p>Prompt before each invocation of the diff tool. This is the default behaviour; the option is provided to override any configuration settings.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt---rotate-toltfilegt"> <a class="anchor" href="#Documentation/git-difftool.txt---rotate-toltfilegt"></a>--rotate-to=<file> </dt> <dd> <p>Start showing the diff for the given path, the paths before it will move to the end and output.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt---skip-toltfilegt"> <a class="anchor" href="#Documentation/git-difftool.txt---skip-toltfilegt"></a>--skip-to=<file> </dt> <dd> <p>Start showing the diff for the given path, skipping all the paths before it.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt--tlttoolgt"> <a class="anchor" href="#Documentation/git-difftool.txt--tlttoolgt"></a>-t <tool> </dt> <dt class="hdlist1" id="Documentation/git-difftool.txt---toollttoolgt"> <a class="anchor" href="#Documentation/git-difftool.txt---toollttoolgt"></a>--tool=<tool> </dt> <dd> <p>Use the diff tool specified by <tool>. Valid values include emerge, kompare, meld, and vimdiff. Run <code>git difftool --tool-help</code> for the list of valid <tool> settings.</p> <div class="paragraph"> <p>If a diff tool is not specified, <em>git difftool</em> will use the configuration variable <code>diff.tool</code>. If the configuration variable <code>diff.tool</code> is not set, <em>git difftool</em> will pick a suitable default.</p> </div> <div class="paragraph"> <p>You can explicitly provide a full path to the tool by setting the configuration variable <code>difftool.<tool>.path</code>. For example, you can configure the absolute path to kdiff3 by setting <code>difftool.kdiff3.path</code>. Otherwise, <em>git difftool</em> assumes the tool is available in PATH.</p> </div> <div class="paragraph"> <p>Instead of running one of the known diff tools, <em>git difftool</em> can be customized to run an alternative program by specifying the command line to invoke in a configuration variable <code>difftool.<tool>.cmd</code>.</p> </div> <div class="paragraph"> <p>When <em>git difftool</em> is invoked with this tool (either through the <code>-t</code> or <code>--tool</code> option or the <code>diff.tool</code> configuration variable) the configured command line will be invoked with the following variables available: <code>$LOCAL</code> is set to the name of the temporary file containing the contents of the diff pre-image and <code>$REMOTE</code> is set to the name of the temporary file containing the contents of the diff post-image. <code>$MERGED</code> is the name of the file which is being compared. <code>$BASE</code> is provided for compatibility with custom merge tool commands and has the same value as <code>$MERGED</code>.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt---tool-help"> <a class="anchor" href="#Documentation/git-difftool.txt---tool-help"></a>--tool-help </dt> <dd> <p>Print a list of diff tools that may be used with <code>--tool</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt---no-symlinks"> <a class="anchor" href="#Documentation/git-difftool.txt---no-symlinks"></a>--[no-]symlinks </dt> <dd> <p><em>git difftool</em>'s default behavior is to create symlinks to the working tree when run in <code>--dir-diff</code> mode and the right-hand side of the comparison yields the same content as the file in the working tree.</p> <div class="paragraph"> <p>Specifying <code>--no-symlinks</code> instructs <em>git difftool</em> to create copies instead. <code>--no-symlinks</code> is the default on Windows.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt--xltcommandgt"> <a class="anchor" href="#Documentation/git-difftool.txt--xltcommandgt"></a>-x <command> </dt> <dt class="hdlist1" id="Documentation/git-difftool.txt---extcmdltcommandgt"> <a class="anchor" href="#Documentation/git-difftool.txt---extcmdltcommandgt"></a>--extcmd=<command> </dt> <dd> <p>Specify a custom command for viewing diffs. <em>git-difftool</em> ignores the configured defaults and runs <code><command> $LOCAL $REMOTE</code> when this option is specified. Additionally, <code>$BASE</code> is set in the environment.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt--g"> <a class="anchor" href="#Documentation/git-difftool.txt--g"></a>-g </dt> <dt class="hdlist1" id="Documentation/git-difftool.txt---no-gui"> <a class="anchor" href="#Documentation/git-difftool.txt---no-gui"></a>--[no-]gui </dt> <dd> <p>When <em>git-difftool</em> is invoked with the <code>-g</code> or <code>--gui</code> option the default diff tool will be read from the configured <code>diff.guitool</code> variable instead of <code>diff.tool</code>. This may be selected automatically using the configuration variable <code>difftool.guiDefault</code>. The <code>--no-gui</code> option can be used to override these settings. If <code>diff.guitool</code> is not set, we will fallback in the order of <code>merge.guitool</code>, <code>diff.tool</code>, <code>merge.tool</code> until a tool is found.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt---no-trust-exit-code"> <a class="anchor" href="#Documentation/git-difftool.txt---no-trust-exit-code"></a>--[no-]trust-exit-code </dt> <dd> <p>Errors reported by the diff tool are ignored by default. Use <code>--trust-exit-code</code> to make <em>git-difftool</em> exit when an invoked diff tool returns a non-zero exit code.</p> <div class="paragraph"> <p><em>git-difftool</em> will forward the exit code of the invoked tool when <code>--trust-exit-code</code> is used.</p> </div> </dd> </dl> </div> <div class="paragraph"> <p>See <a href='/docs/git-diff'>git-diff[1]</a> for the full list of supported options.</p> </div> </div> </div> <div class="sect1"> <h2 id="_configuration"><a class="anchor" href="#_configuration"></a>CONFIGURATION</h2> <div class="sectionbody"> <div class="paragraph"> <p><em>git difftool</em> falls back to <em>git mergetool</em> config variables when the difftool equivalents have not been defined.</p> </div> <div class="paragraph"> <p>Everything above this line in this section isn’t included from the <a href='/docs/git-config'>git-config[1]</a> documentation. The content that follows is the same as what’s found there:</p> </div> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-difftool.txt-difftool"> <a class="anchor" href="#Documentation/git-difftool.txt-difftool"></a>diff.tool </dt> <dd> <p>Controls which diff tool is used by <a href='/docs/git-difftool'>git-difftool[1]</a>. This variable overrides the value configured in <code>merge.tool</code>. The list below shows the valid built-in values. Any other value is treated as a custom diff tool and requires that a corresponding difftool.<tool>.cmd variable is defined.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt-diffguitool"> <a class="anchor" href="#Documentation/git-difftool.txt-diffguitool"></a>diff.guitool </dt> <dd> <p>Controls which diff tool is used by <a href='/docs/git-difftool'>git-difftool[1]</a> when the -g/--gui flag is specified. This variable overrides the value configured in <code>merge.guitool</code>. The list below shows the valid built-in values. Any other value is treated as a custom diff tool and requires that a corresponding difftool.<guitool>.cmd variable is defined.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt-difftoollttoolgtcmd"> <a class="anchor" href="#Documentation/git-difftool.txt-difftoollttoolgtcmd"></a>difftool.<tool>.cmd </dt> <dd> <p>Specify the command to invoke the specified diff tool. The specified command is evaluated in shell with the following variables available: <em>LOCAL</em> is set to the name of the temporary file containing the contents of the diff pre-image and <em>REMOTE</em> is set to the name of the temporary file containing the contents of the diff post-image.</p> <div class="paragraph"> <p>See the <code>--tool=<tool></code> option in <a href='/docs/git-difftool'>git-difftool[1]</a> for more details.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt-difftoollttoolgtpath"> <a class="anchor" href="#Documentation/git-difftool.txt-difftoollttoolgtpath"></a>difftool.<tool>.path </dt> <dd> <p>Override the path for the given tool. This is useful in case your tool is not in the PATH.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt-difftooltrustExitCode"> <a class="anchor" href="#Documentation/git-difftool.txt-difftooltrustExitCode"></a>difftool.trustExitCode </dt> <dd> <p>Exit difftool if the invoked diff tool returns a non-zero exit status.</p> <div class="paragraph"> <p>See the <code>--trust-exit-code</code> option in <a href='/docs/git-difftool'>git-difftool[1]</a> for more details.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt-difftoolprompt"> <a class="anchor" href="#Documentation/git-difftool.txt-difftoolprompt"></a>difftool.prompt </dt> <dd> <p>Prompt before each invocation of the diff tool.</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt-difftoolguiDefault"> <a class="anchor" href="#Documentation/git-difftool.txt-difftoolguiDefault"></a>difftool.guiDefault </dt> <dd> <p>Set <code>true</code> to use the <code>diff.guitool</code> by default (equivalent to specifying the <code>--gui</code> argument), or <code>auto</code> to select <code>diff.guitool</code> or <code>diff.tool</code> depending on the presence of a <code>DISPLAY</code> environment variable value. The default is <code>false</code>, where the <code>--gui</code> argument must be provided explicitly for the <code>diff.guitool</code> to be used.</p> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_see_also"><a class="anchor" href="#_see_also"></a>SEE ALSO</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-difftool.txt-ahrefrelurldocsgit-diffgit-diff1a"> <a class="anchor" href="#Documentation/git-difftool.txt-ahrefrelurldocsgit-diffgit-diff1a"></a><a href='/docs/git-diff'>git-diff[1]</a> </dt> <dd> <p>Show changes between commits, commit and working tree, etc</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt-ahrefrelurldocsgit-mergetoolgit-mergetool1a"> <a class="anchor" href="#Documentation/git-difftool.txt-ahrefrelurldocsgit-mergetoolgit-mergetool1a"></a><a href='/docs/git-mergetool'>git-mergetool[1]</a> </dt> <dd> <p>Run merge conflict resolution tools to resolve merge conflicts</p> </dd> <dt class="hdlist1" id="Documentation/git-difftool.txt-ahrefrelurldocsgit-configgit-config1a"> <a class="anchor" href="#Documentation/git-difftool.txt-ahrefrelurldocsgit-configgit-config1a"></a><a href='/docs/git-config'>git-config[1]</a> </dt> <dd> <p>Get and set repository or global options</p> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_git"><a class="anchor" href="#_git"></a>GIT</h2> <div class="sectionbody"> <div class="paragraph"> <p>Part of the <a href='/docs/git'>git[1]</a> suite</p> </div> </div> </div> <h3 hidden="true" data-pagefind-weight="10">difftool</h3> </div> </div> </div> <footer> <div class="site-source"> <a href="/site">About this site</a><br> Patches, suggestions, and comments are welcome. </div> <div class="sfc-member"> Git is a member of <a href="/sfc">Software Freedom Conservancy</a> </div> </footer> <a href="#top" class="no-js scrollToTop" id="scrollToTop" data-label="Scroll to top"> <img src="/images/icons/chevron-up@2x.png" width="20" height="20" alt="scroll-to-top"/> </a> <script src="/js/jquery-1.7.1.min.js"></script> <script src="/js/jquery-ui-1.8.18.custom.min.js"></script> <script src="/js/jquery.defaultvalue.js"></script> <script src="/js/session.min.js"></script> <script src="/js/application.min.js"></script> </div> </body> </html>