{
    "content": [
        {
            "type": "text",
            "text": "# git-difftool (info)\n\n## NAME\n\ngit-difftool - Show changes using common diff tools\n\n## SYNOPSIS\n\ngit difftool [<options>] [<commit> [<commit>]] [--] [<path>...]\n\n## DESCRIPTION\n\ngit difftool is a Git command that allows you to compare and edit files\nbetween revisions using common diff tools. git difftool is a frontend\nto git diff and accepts the same options and arguments. See git-\ndiff(1).\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (4 subsections)\n- **CONFIG VARIABLES**\n- **SEE ALSO**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "git-difftool",
        "section": "",
        "mode": "info",
        "summary": "git-difftool - Show changes using common diff tools",
        "synopsis": "git difftool [<options>] [<commit> [<commit>]] [--] [<path>...]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-d",
                "long": "--dir-diff",
                "arg": null,
                "description": "Copy the modified files to a temporary location and perform a directory diff on them. This mode never prompts before launching the diff tool."
            },
            {
                "flag": "-y",
                "long": "--no-prompt",
                "arg": null,
                "description": "Do not prompt before launching a diff tool."
            },
            {
                "flag": "",
                "long": "--prompt",
                "arg": null,
                "description": "Prompt before each invocation of the diff tool. This is the default behaviour; the option is provided to override any configuration settings. --rotate-to=<file> Start showing the diff for the given path, the paths before it will move to end and output. --skip-to=<file> Start showing the diff for the given path, skipping all the paths before it. -t <tool>, --tool=<tool> Use the diff tool specified by <tool>. Valid values include emerge, kompare, meld, and vimdiff. Run git difftool --tool-help for the list of valid <tool> settings. If a diff tool is not specified, git difftool will use the configuration variable diff.tool. If the configuration variable diff.tool is not set, git difftool will pick a suitable default. 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."
            },
            {
                "flag": "",
                "long": "--tool-help",
                "arg": null,
                "description": "Print a list of diff tools that may be used with --tool. --[no-]symlinks git difftool's default behavior is create symlinks to the working tree when run in --dir-diff mode 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. --no-symlinks is the default on Windows. -x <command>, --extcmd=<command> Specify a custom command for viewing diffs. git-difftool ignores the configured defaults and runs $command $LOCAL $REMOTE when this option is specified. Additionally, $BASE is set in the environment. -g, --[no-]gui When git-difftool is invoked with the -g or --gui option the default diff tool will be read from the configured diff.guitool variable instead of diff.tool. The --no-gui option can be used to override this setting. If diff.guitool is not set, we will fallback in the order of merge.guitool, diff.tool, merge.tool until a tool is found. --[no-]trust-exit-code git-difftool invokes a diff tool individually on each file. Errors reported by the diff tool are ignored by default. Use --trust-exit-code to make git-difftool exit 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."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "git-diff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-diff/1/json"
            },
            {
                "name": "git-mergetool",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-mergetool/1/json"
            },
            {
                "name": "git-config",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-config/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-d, --dir-diff",
                        "lines": 4,
                        "flag": "-d",
                        "long": "--dir-diff"
                    },
                    {
                        "name": "-y, --no-prompt",
                        "lines": 2,
                        "flag": "-y",
                        "long": "--no-prompt"
                    },
                    {
                        "name": "--prompt",
                        "lines": 41,
                        "long": "--prompt"
                    },
                    {
                        "name": "--tool-help",
                        "lines": 34,
                        "long": "--tool-help"
                    }
                ]
            },
            {
                "name": "CONFIG VARIABLES",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-difftool - Show changes using common diff tools\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git difftool [<options>] [<commit> [<commit>]] [--] [<path>...]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "git difftool is a Git command that allows you to compare and edit files\nbetween revisions using common diff tools. git difftool is a frontend\nto git diff and accepts the same options and arguments. See git-\ndiff(1).\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-d, --dir-diff",
                        "content": "Copy the modified files to a temporary location and perform a\ndirectory diff on them. This mode never prompts before launching\nthe diff tool.\n",
                        "flag": "-d",
                        "long": "--dir-diff"
                    },
                    {
                        "name": "-y, --no-prompt",
                        "content": "Do not prompt before launching a diff tool.\n",
                        "flag": "-y",
                        "long": "--no-prompt"
                    },
                    {
                        "name": "--prompt",
                        "content": "Prompt before each invocation of the diff tool. This is the default\nbehaviour; the option is provided to override any configuration\nsettings.\n\n--rotate-to=<file>\nStart showing the diff for the given path, the paths before it will\nmove to end and output.\n\n--skip-to=<file>\nStart showing the diff for the given path, skipping all the paths\nbefore it.\n\n-t <tool>, --tool=<tool>\nUse the diff tool specified by <tool>. Valid values include emerge,\nkompare, meld, and vimdiff. Run git difftool --tool-help for the\nlist of valid <tool> settings.\n\nIf a diff tool is not specified, git difftool will use the\nconfiguration variable diff.tool. If the configuration variable\ndiff.tool is not set, git difftool will pick a suitable default.\n\nYou can explicitly provide a full path to the tool by setting the\nconfiguration variable difftool.<tool>.path. For example, you can\nconfigure the absolute path to kdiff3 by setting\ndifftool.kdiff3.path. Otherwise, git difftool assumes the tool is\navailable in PATH.\n\nInstead of running one of the known diff tools, git difftool can be\ncustomized to run an alternative program by specifying the command\nline to invoke in a configuration variable difftool.<tool>.cmd.\n\nWhen git difftool is invoked with this tool (either through the -t\nor --tool option or the diff.tool configuration variable) the\nconfigured command line will be invoked with the following\nvariables available: $LOCAL is set to the name of the temporary\nfile containing the contents of the diff pre-image and $REMOTE is\nset to the name of the temporary file containing the contents of\nthe diff post-image.  $MERGED is the name of the file which is\nbeing compared.  $BASE is provided for compatibility with custom\nmerge tool commands and has the same value as $MERGED.\n",
                        "long": "--prompt"
                    },
                    {
                        "name": "--tool-help",
                        "content": "Print a list of diff tools that may be used with --tool.\n\n--[no-]symlinks\ngit difftool's default behavior is create symlinks to the working\ntree when run in --dir-diff mode and the right-hand side of the\ncomparison yields the same content as the file in the working tree.\n\nSpecifying --no-symlinks instructs git difftool to create copies\ninstead.  --no-symlinks is the default on Windows.\n\n-x <command>, --extcmd=<command>\nSpecify a custom command for viewing diffs.  git-difftool ignores\nthe configured defaults and runs $command $LOCAL $REMOTE when this\noption is specified. Additionally, $BASE is set in the environment.\n\n-g, --[no-]gui\nWhen git-difftool is invoked with the -g or --gui option the\ndefault diff tool will be read from the configured diff.guitool\nvariable instead of diff.tool. The --no-gui option can be used to\noverride this setting. If diff.guitool is not set, we will fallback\nin the order of merge.guitool, diff.tool, merge.tool until a tool\nis found.\n\n--[no-]trust-exit-code\ngit-difftool invokes a diff tool individually on each file. Errors\nreported by the diff tool are ignored by default. Use\n--trust-exit-code to make git-difftool exit when an invoked diff\ntool returns a non-zero exit code.\n\ngit-difftool will forward the exit code of the invoked tool when\n--trust-exit-code is used.\n\nSee git-diff(1) for the full list of supported options.\n",
                        "long": "--tool-help"
                    }
                ]
            },
            "CONFIG VARIABLES": {
                "content": "git difftool falls back to git mergetool config variables when the\ndifftool equivalents have not been defined.\n\ndiff.tool\nThe default diff tool to use.\n\ndiff.guitool\nThe default diff tool to use when --gui is specified.\n\ndifftool.<tool>.path\nOverride the path for the given tool. This is useful in case your\ntool is not in the PATH.\n\ndifftool.<tool>.cmd\nSpecify the command to invoke the specified diff tool.\n\nSee the --tool=<tool> option above for more details.\n\ndifftool.prompt\nPrompt before each invocation of the diff tool.\n\ndifftool.trustExitCode\nExit difftool if the invoked diff tool returns a non-zero exit\nstatus.\n\nSee the --trust-exit-code option above for more details.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "git-diff(1)\nShow changes between commits, commit and working tree, etc\n\ngit-mergetool(1)\nRun merge conflict resolution tools to resolve merge conflicts\n\ngit-config(1)\nGet and set repository or global options\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\nGit 2.34.1                        02/26/2026                   GIT-DIFFTOOL(1)",
                "subsections": []
            }
        }
    }
}