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.
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.
First, look at the error message to identify which driver is missing:
error: cannot run diff driver 'jupyternotebook': No such file or directoryThe driver name is shown in quotes (in this case, 'jupyternotebook').
View the .gitattributes file to see which files use this driver:
cat .gitattributesYou might see something like:
*.ipynb diff=jupyternotebook
*.csv diff=csv_diffAdd 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:
git config --global diff.jupyternotebook.command 'git-nbdiffdriver diff'For a local configuration:
git config diff.jupyternotebook.command 'git-nbdiffdriver diff'Replace 'jupyternotebook' with your driver name and the command with the appropriate executable.
If the driver command requires a specific tool, make sure it's installed and in your PATH:
For nbdime (Jupyter notebooks):
pip install nbdimeFor 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
Check that your Git config includes the driver:
git config --list | grep diffYou should see something like:
diff.jupyternotebook.command=git-nbdiffdriver diffThen test the diff command:
git diffIf you need to view diffs immediately and can't set up the driver, you can temporarily disable it:
git --no-pager diff --no-ext-diffThe --no-ext-diff flag tells Git to use its default diff behavior and ignore custom drivers.
Or rename .gitattributes temporarily:
mv .gitattributes .gitattributes.bak
git diff
mv .gitattributes.bak .gitattributesSecurity 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:
git config diff.drivername.trustExitCode trueWith 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:
git show --ext-diff
git log -p --ext-diffGlobal 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.
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server
fatal: unable to access: Proxy auto-configuration failed
How to fix 'Proxy auto-configuration failed' in Git
fatal: unable to access: Authentication failed (proxy requires basic auth)
How to fix 'Authentication failed (proxy requires basic auth)' in Git
fatal: unable to access: no_proxy configuration not working
How to fix 'no_proxy configuration not working' in Git
fatal: unable to read tree object in treeless clone
How to fix 'unable to read tree object in treeless clone' in Git