Git cannot locate the configured diff tool in your PATH or the tool is not installed. This prevents git difftool from launching the visual diff application.
This error occurs when Git's difftool command cannot find or execute the diff tool you've configured (or the default tool it's trying to use). Git difftool is a frontend to git diff that allows you to compare files using external graphical or text-based diff applications like vimdiff, meld, Beyond Compare, or other tools. When you run `git difftool`, Git looks for the configured tool in several places: first in the `diff.tool` configuration variable, then checks if that tool is available in your system PATH, and finally attempts to execute it. If the tool binary doesn't exist, isn't executable, or the path is incorrectly configured, Git fails with this error. This is particularly common after fresh Git installations, when switching between operating systems, or when a diff tool has been uninstalled or moved to a different location.
First, see what Git is trying to use:
git config --get diff.toolIf this returns nothing, Git will try to use a default tool. To see all available built-in tools, run:
git difftool --tool-helpThis shows which tools Git recognizes and which are currently available on your system.
Check if your diff tool is actually installed and accessible:
# For vimdiff (vim)
vim --version
# For meld
meld --version
# For Beyond Compare (Windows)
bcomp /?
# Generic check if tool is in PATH
which vimdiff # Linux/macOS
where meld # WindowsIf the command is not found, you need to install the tool first.
Install the diff tool if it's missing:
Ubuntu/Debian:
sudo apt update
sudo apt install vim # for vimdiff
sudo apt install meld # for meldmacOS:
brew install vim
brew install meldWindows:
- Download and install [Meld](https://meldmerge.org/)
- Or [Beyond Compare](https://www.scootersoftware.com/)
- Or use vim from [Git for Windows](https://gitforwindows.org/) (includes vimdiff)
Red Hat/CentOS/Fedora:
sudo yum install vim-enhanced
sudo yum install meldSet the diff tool in your Git configuration:
For vimdiff:
git config --global diff.tool vimdiff
git config --global difftool.prompt falseFor meld:
git config --global diff.tool meld
git config --global difftool.prompt falseFor Beyond Compare 3:
git config --global diff.tool bc3
git config --global difftool.prompt falseThe difftool.prompt false setting prevents Git from asking for confirmation before launching the tool each time.
If the tool is installed but not in your system PATH, configure the full path:
Windows (Beyond Compare 4):
git config --global difftool.bc3.path 'C:/Program Files/Beyond Compare 4/bcomp.exe'Windows (Meld):
git config --global difftool.meld.path 'C:/Program Files/Meld/Meld.exe'macOS/Linux (custom location):
git config --global difftool.meld.path '/usr/local/bin/meld'Note: Use forward slashes (/) even on Windows, or escape backslashes properly.
Verify git difftool now works:
# Make a change to a tracked file
echo 'test change' >> README.md
# Try launching difftool
git difftoolYour configured diff tool should open and display the changes. If you want to see all changes in directory diff mode:
git difftool -dThis copies modified files to a temp location and shows a directory comparison, which is more efficient for reviewing many files.
For custom diff tools: If you're using a tool that isn't built into Git's list, you need to define both the tool name and the command to run. For example, for a custom tool called 'customdiff':
git config --global diff.tool customdiff
git config --global difftool.customdiff.cmd 'customdiff "$LOCAL" "$REMOTE"'Git provides $LOCAL and $REMOTE variables that point to temporary files containing the pre-image and post-image of your diff.
GUI vs CLI tools: If you want different tools for GUI and command-line contexts, use diff.guitool and the --gui or -g flag:
git config --global diff.guitool meld
git config --global diff.tool vimdiff
git difftool --gui # uses meld
git difftool # uses vimdiffHandling exit codes: By default, Git ignores errors from the diff tool. If you want Git to respect the tool's exit code (useful for scripting):
git config --global difftool.trustExitCode trueLinux IUS repositories: If you installed git from IUS repositories and see "cannot run git-difftool--helper", you likely only have git-core installed. Install the full git package:
sudo yum install git222 # or your git versionViewing your entire difftool config:
git config --global --get-regexp difftool
git config --global --get-regexp 'diff\.tool'warning: BOM detected in file, this may cause issues
UTF-8 Byte Order Mark (BOM) detected in file
fatal: Server does not support --shallow-exclude
Server does not support --shallow-exclude
warning: filtering out blobs larger than limit
Git partial clone filtering large blobs warning
fatal: Server does not support --shallow-since
Server does not support --shallow-since in Git
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server