How to fix error: cannot run diff driver 'driver-name': No such file or directory in Git

GitINTERMEDIATEMEDIUMUpdated Dec 2, 2025ยท 136 views

This error occurs when Git tries to use a custom diff driver specified in .gitattributes, but the driver command is not found or not properly configured in your Git config.

Quick fix

Fixes error: cannot run diff driver 'driver-name': No such file or directory

error: cannot run diff driver 'jupyternotebook': No such file or directory
  1. Identify the missing diff driver
  2. Check your .gitattributes file
  3. Configure the diff driver in your Git config
  4. Install the required driver tool
git โ€” error
error: cannot run diff driver 'jupyternotebook': No such file or directory
error: cannot run diff driver 'driver-name': No such file or directory

What this error means

This error indicates that Git found a diff driver reference in your .gitattributes file, but the corresponding driver command is either not configured in your Git config or the executable is not available in your PATH. Git's diff driver system allows you to customize how diffs are generated for specific file types. This requires two-part configuration: first, you define which files use a driver in .gitattributes (e.g., '*.ipynb diff=jupyternotebook'), and second, you configure what command the driver runs in your .git/config or ~/.gitconfig file. The error occurs when there's a mismatch between these two configurations - your .gitattributes references a driver that hasn't been properly set up in your Git configuration.

Typical symptoms

  • Git diff, log, or show commands fail with "cannot run diff driver" error
  • Error message includes the name of the missing driver
  • Commands work after removing or commenting out .gitattributes entries
  • Other team members can run diff successfully with the same repository
  • Error appears after cloning a repository or pulling .gitattributes changes

Common causes

  1. Diff driver is defined in .gitattributes but not configured in .git/config or ~/.gitconfig
  2. Driver command is configured but the executable is not installed or not in PATH
  3. Typo or mismatch between driver name in .gitattributes and config file
  4. Cloned a repository with .gitattributes but custom drivers were not set up locally
  5. Driver command was removed or uninstalled after initial configuration

How to fix "error: cannot run diff driver 'driver-name': No such file or directory"

1Identify the missing diff driver

First, look at the error message to identify which driver is missing:

bash
error: cannot run diff driver 'jupyternotebook': No such file or directory

The driver name is shown in quotes (in this case, 'jupyternotebook').

2Check your .gitattributes file

View the .gitattributes file to see which files use this driver:

bash
cat .gitattributes

You might see something like:

bash
*.ipynb diff=jupyternotebook
*.csv diff=csv_diff
3Configure the diff driver in your Git config

Add the driver configuration to your Git config. You can do this globally (for all repos) or locally (for just this repo):

For a global configuration:

bash
git config --global diff.jupyternotebook.command 'git-nbdiffdriver diff'

For a local configuration:

bash
git config diff.jupyternotebook.command 'git-nbdiffdriver diff'

Replace 'jupyternotebook' with your driver name and the command with the appropriate executable.

4Install the required driver tool

If the driver command requires a specific tool, make sure it's installed and in your PATH:

For nbdime (Jupyter notebooks):

bash
pip install nbdime

For other custom diff drivers:

Check the repository documentation or team wiki for installation instructions. Common diff drivers include:
- git-nbdiffdriver (Jupyter notebooks)
- git-diff-drivers collection (various file types)
- Custom scripts specific to your project

5Verify the configuration

Check that your Git config includes the driver:

bash
git config --list | grep diff

You should see something like:

bash
diff.jupyternotebook.command=git-nbdiffdriver diff

Then test the diff command:

bash
git diff
6Alternative: Temporarily disable the custom driver

If you need to view diffs immediately and can't set up the driver, you can temporarily disable it:

bash
git --no-pager diff --no-ext-diff

The --no-ext-diff flag tells Git to use its default diff behavior and ignore custom drivers.

Or rename .gitattributes temporarily:

bash
mv .gitattributes .gitattributes.bak
git diff
mv .gitattributes.bak .gitattributes

Advanced notes

Security Consideration:
Custom diff drivers are not automatically cloned with repositories for security reasons. This prevents malicious repositories from executing arbitrary code on your system. Team members must explicitly configure drivers locally.

Exit Code Behavior:
By default, Git expects diff drivers to return exit code 0 regardless of whether files differ. You can change this with:

bash
git config diff.drivername.trustExitCode true

With this setting, the driver should return 0 for equal files and 1 for different files (like standard diff).

Using --ext-diff:
Many Git commands (like git log and git show) only use external diff drivers when you specify the --ext-diff flag explicitly:

bash
git show --ext-diff
git log -p --ext-diff

Global vs Local Configuration:
Consider whether to set up drivers globally or per-repository. Global setup (~/.gitconfig) is convenient if you work with many repos using the same file types. Local setup (.git/config) is better for project-specific drivers.

Frequently asked questions

What does "error: cannot run diff driver 'driver-name': No such file or directory" mean?
gitattributes file, but the corresponding driver command is either not configured in your Git config or the executable is not available in your PATH. Git's diff driver system allows you to customize how diffs are generated for specific file types. gitconfig file.
How do I fix "error: cannot run diff driver 'driver-name': No such file or directory"?
This error occurs when Git tries to use a custom diff driver specified in .gitattributes, but the driver command is not found or not properly configured in your Git config.
What causes "error: cannot run diff driver 'driver-name': No such file or directory"?
Diff driver is defined in .gitattributes but not configured in .git/config or ~/.gitconfig Driver command is configured but the executable is not installed or not in PATH Typo or mismatch between driver name in .gitattributes and config file
Is the "error: cannot run diff driver 'driver-name': No such file or directory" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading