Git fork
at reftables-rust 142 lines 4.6 kB view raw
1git-difftool(1) 2=============== 3 4NAME 5---- 6git-difftool - Show changes using common diff tools 7 8SYNOPSIS 9-------- 10[verse] 11'git difftool' [<options>] [<commit> [<commit>]] [--] [<path>...] 12 13DESCRIPTION 14----------- 15'git difftool' is a Git command that allows you to compare and edit files 16between revisions using common diff tools. 'git difftool' is a frontend 17to 'git diff' and accepts the same options and arguments. See 18linkgit:git-diff[1]. 19 20OPTIONS 21------- 22-d:: 23--dir-diff:: 24 Copy the modified files to a temporary location and perform 25 a directory diff on them. This mode never prompts before 26 launching the diff tool. 27 28-y:: 29--no-prompt:: 30 Do not prompt before launching a diff tool. 31 32--prompt:: 33 Prompt before each invocation of the diff tool. 34 This is the default behaviour; the option is provided to 35 override any configuration settings. 36 37--rotate-to=<file>:: 38 Start showing the diff for the given path, 39 the paths before it will move to the end and output. 40 41--skip-to=<file>:: 42 Start showing the diff for the given path, skipping all 43 the paths before it. 44 45-t <tool>:: 46--tool=<tool>:: 47 Use the diff tool specified by <tool>. Valid values include 48 emerge, kompare, meld, and vimdiff. Run `git difftool --tool-help` 49 for the list of valid <tool> settings. 50+ 51If a diff tool is not specified, 'git difftool' 52will use the configuration variable `diff.tool`. If the 53configuration variable `diff.tool` is not set, 'git difftool' 54will pick a suitable default. 55+ 56You can explicitly provide a full path to the tool by setting the 57configuration variable `difftool.<tool>.path`. For example, you 58can configure the absolute path to kdiff3 by setting 59`difftool.kdiff3.path`. Otherwise, 'git difftool' assumes the 60tool is available in PATH. 61+ 62Instead of running one of the known diff tools, 63'git difftool' can be customized to run an alternative program 64by specifying the command line to invoke in a configuration 65variable `difftool.<tool>.cmd`. 66+ 67When 'git difftool' is invoked with this tool (either through the 68`-t` or `--tool` option or the `diff.tool` configuration variable) 69the configured command line will be invoked with the following 70variables available: `$LOCAL` is set to the name of the temporary 71file containing the contents of the diff pre-image and `$REMOTE` 72is set to the name of the temporary file containing the contents 73of the diff post-image. `$MERGED` is the name of the file which is 74being compared. `$BASE` is provided for compatibility 75with custom merge tool commands and has the same value as `$MERGED`. 76 77--tool-help:: 78 Print a list of diff tools that may be used with `--tool`. 79 80--symlinks:: 81--no-symlinks:: 82 'git difftool''s default behavior is to create symlinks to the 83 working tree when run in `--dir-diff` mode and the right-hand 84 side of the comparison yields the same content as the file in 85 the working tree. 86+ 87Specifying `--no-symlinks` instructs 'git difftool' to create copies 88instead. `--no-symlinks` is the default on Windows. 89 90-x <command>:: 91--extcmd=<command>:: 92 Specify a custom command for viewing diffs. 93 'git-difftool' ignores the configured defaults and runs 94 `<command> $LOCAL $REMOTE` when this option is specified. 95 Additionally, `$BASE` is set in the environment. 96 97-g:: 98--gui:: 99--no-gui:: 100 When 'git-difftool' is invoked with the `-g` or `--gui` option 101 the default diff tool will be read from the configured 102 `diff.guitool` variable instead of `diff.tool`. This may be 103 selected automatically using the configuration variable 104 `difftool.guiDefault`. The `--no-gui` option can be used to 105 override these settings. If `diff.guitool` is not set, we will 106 fallback in the order of `merge.guitool`, `diff.tool`, 107 `merge.tool` until a tool is found. 108 109--trust-exit-code:: 110--no-trust-exit-code:: 111 Errors reported by the diff tool are ignored by default. 112 Use `--trust-exit-code` to make 'git-difftool' exit when an 113 invoked diff tool returns a non-zero exit code. 114+ 115'git-difftool' will forward the exit code of the invoked tool when 116`--trust-exit-code` is used. 117 118See linkgit:git-diff[1] for the full list of supported options. 119 120CONFIGURATION 121------------- 122'git difftool' falls back to 'git mergetool' config variables when the 123difftool equivalents have not been defined. 124 125include::includes/cmd-config-section-rest.adoc[] 126 127include::config/difftool.adoc[] 128 129SEE ALSO 130-------- 131linkgit:git-diff[1]:: 132 Show changes between commits, commit and working tree, etc 133 134linkgit:git-mergetool[1]:: 135 Run merge conflict resolution tools to resolve merge conflicts 136 137linkgit:git-config[1]:: 138 Get and set repository or global options 139 140GIT 141--- 142Part of the linkgit:git[1] suite