GIT-DIFFTOOL(1)
π GIT-DIFFTOOL(1) π
okay so bestie, welcome to git-difftool β this is the page straight out of the Git manual (you're in the GIT-DIFFTOOL(1) section, iykyk), and honestly? it's giving "let me show you your changes in literally any diff tool you want" energy. let's go π«Ά
β¨ NAME β¨
git-difftool β show changes using common diff tools
πΈ SYNOPSIS πΈ
git difftool [<options>] [<commit> [<commit>]] [--] [<path>...]
π¦ DESCRIPTION π¦
git difftool is a Git command that lets you compare and edit files between revisions using common diff tools. no cap, that's the whole vibe.
it's a frontend to git diff β so it accepts the same options and arguments. see git-diff(1) for the tea on those. π
π OPTIONS π
-d,--dir-diffβ copies the modified files to a temporary location and does a whole directory diff on them. and heads up: this mode never prompts before launching the diff tool. like, it just goes. πββοΈ-y,--no-promptβ do not prompt before launching a diff tool. zero questions asked.--promptβ prompt before each invocation of the diff tool. this is the default behaviour, btw β the option exists purely so you can override any configuration settings that say otherwise.--rotate-to=<file>β start showing the diff for<file>, and the paths before it get moved to the end and output. cute lil carousel, lowkey. π--skip-to=<file>β start showing the diff for<file>, skipping all the paths before it entirely. bye bestie π-t <tool>,--tool=<tool>β use the diff tool specified by<tool>. valid values includeemerge,kompare,meld, andvimdiff. rungit difftool --tool-helpfor the list of valid<tool>settings. so helpful of it.
if a diff tool is not specified, git difftool will use the configuration variable diff.tool. if diff.tool is not set either, git difftool will pick a suitable default. it's got you. π«Ά
you can explicitly provide a full path to the tool by setting the configuration variable difftool.<tool>.path. for example, you can configure the absolute path to kdiff3 by setting difftool.kdiff3.path. otherwise, git difftool assumes the tool is available in PATH.
instead of running one of the known diff tools, git difftool can be customized to run an alternative program by specifying the command line to invoke in a configuration variable difftool.<tool>.cmd.
when git difftool is invoked with this tool (either through the -t or --tool option or the diff.tool configuration variable) the configured command line will be invoked with the following variables available: $LOCAL is set to the name of the temporary file containing the contents of the diff pre-image and $REMOTE is set to the name of the temporary file containing the contents of the diff post-image. $MERGED is the name of the file which is being compared. $BASE is provided for compatibility with custom merge tool commands and has the same value as $MERGED. periodt. π
--tool-helpβ print a list of diff tools that may be used with--tool. the menu, basically. π--symlinks,--no-symlinksβgit difftool's default behavior is to create symlinks to the working tree when run in--dir-diffmode and the right-hand side of the comparison yields the same content as the file in the working tree.
specifying --no-symlinks instructs git difftool to create copies instead. and --no-symlinks is the default on Windows. πͺ
-x <command>,--extcmd=<command>β specify a custom command for viewing diffs.git-difftoolignores the configured defaults and runs<command> $LOCAL $REMOTEwhen this option is specified. additionally,$BASEis set in the environment. main character command energy, honestly. π-g,--gui,--no-guiβ whengit-difftoolis invoked with the-gor--guioption, the default diff tool will be read from the configureddiff.guitoolvariable instead ofdiff.tool. this may be selected automatically using the configuration variabledifftool.guiDefault. the--no-guioption can be used to override these settings. ifdiff.guitoolis not set, we will fallback in the order ofmerge.guitool,diff.tool,merge.tooluntil a tool is found. it's a whole search party π--trust-exit-code,--no-trust-exit-codeβ errors reported by the diff tool are ignored by default. π¬ use--trust-exit-codeto makegit-difftoolexit when an invoked diff tool returns a non-zero exit code.
git-difftool will forward the exit code of the invoked tool when --trust-exit-code is used.
see git-diff(1) for the full list of supported options.
π CONFIGURATION π
git difftool falls back to git mergetool config variables when the difftool equivalents have not been defined. it's very "oh no you didn't set it, that's fine, i know a guy" of it.
everything above this line in this section isn't included from the git-config(1) documentation. the content that follows is the same as what's found there:
diff.toolβ controls which diff tool is used bygit-difftool(1). this variable overrides the value configured inmerge.tool. the list below shows the valid built-in values. any other value is treated as a custom diff tool and requires that a correspondingdifftool.<tool>.cmdvariable is defined.diff.guitoolβ controls which diff tool is used bygit-difftool(1)when the-g/--guiflag is specified. this variable overrides the value configured inmerge.guitool. the list below shows the valid built-in values. any other value is treated as a custom diff tool and requires that a correspondingdifftool.<guitool>.cmdvariable is defined.
π§ the built-in tool roster (a vibe check)
araxisβ use Araxis Merge (requires a graphical session)bcβ use Beyond Compare (requires a graphical session)bc3β use Beyond Compare (requires a graphical session)bc4β use Beyond Compare (requires a graphical session)codecompareβ use Code Compare (requires a graphical session)deltawalkerβ use DeltaWalker (requires a graphical session)diffmergeβ use DiffMerge (requires a graphical session)diffuseβ use Diffuse (requires a graphical session)ecmergeβ use ECMerge (requires a graphical session)emergeβ use Emacs' Emergeexamdiffβ use ExamDiff Pro (requires a graphical session)guiffyβ use Guiffy's Diff Tool (requires a graphical session)gvimdiffβ use gVim (requires a graphical session)kdiff3β use KDiff3 (requires a graphical session)kompareβ use Kompare (requires a graphical session)meldβ use Meld (requires a graphical session)nvimdiffβ use Neovimopendiffβ use FileMerge (requires a graphical session)p4mergeβ use HelixCore P4Merge (requires a graphical session)smergeβ use Sublime Merge (requires a graphical session)tkdiffβ use TkDiff (requires a graphical session)vimdiffβ use Vimvscodeβ use Visual Studio Code (requires a graphical session)winmergeβ use WinMerge (requires a graphical session)xxdiffβ use xxdiff (requires a graphical session)
π the rest of the config besties
difftool.<tool>.cmdβ specify the command to invoke the specified diff tool. the specified command is evaluated in shell with the following variables available:LOCALis set to the name of the temporary file containing the contents of the diff pre-image andREMOTEis set to the name of the temporary file containing the contents of the diff post-image.
see the --tool=<tool> option in git-difftool(1) for more details.
difftool.<tool>.pathβ override the path for the given tool. this is useful in case your tool is not in thePATH. πdifftool.trustExitCodeβ exit difftool if the invoked diff tool returns a non-zero exit status.
see the --trust-exit-code option in git-difftool(1) for more details.
difftool.promptβ prompt before each invocation of the diff tool.difftool.guiDefaultβ settrueto use thediff.guitoolby default (equivalent to specifying the--guiargument), orautoto selectdiff.guitoolordiff.tooldepending on the presence of aDISPLAYenvironment variable value. the default isfalse, where the--guiargument must be provided explicitly for thediff.guitoolto be used. ngl theautoone is kind of iconic β¨
β SEE ALSO β
git-diff(1)β show changes between commits, commit and working tree, etcgit-mergetool(1)β run merge conflict resolution tools to resolve merge conflictsgit-config(1)β get and set repository or global options
π GIT π
part of the git(1) suite π
and that's the whole page bestie!! mwah π
source + version + date, one last time, with love: Git 2.56.0, dated 2026-09-27, and this was the GIT-DIFFTOOL(1) page. slay, go diff something pretty π
β¨
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms