Search code examples
gitmsysgitbeyondcompare3

git difftool --dir-diff is not creating temp files for Beyond Compare 3 to use


I'm trying to use git's new (as of git 1.7.11) directory diff command with Beyond Compare 3 as the difftool, but the temporary files are not being created.

For example:

git difftool --dir-diff <branch1> <branch2>

Beyond Compare opens a directory comparison with the correct directories and changed files listed.

However, when I click on any of the files I get the following error:

Unable to load C:\Users\<username>\AppData\Local\Temp\git-difftool.yG8V5\left\<path to some file>: The system cannot find the path specified

So, I check to see if the C:\Users\<username>\AppData\Local\Temp\git-difftool.yG8V5 directory exists and it doesn't.

Beyond Compare 3 works fine as the difftool for non-directory diffs and merges.

I'm using git for Windows (msysgit) 1.8.0.

Here are the relevant .gitconfig settings:

# External Visual Diff/Merge Tool
[diff]
    tool = bc3

[difftool "bc3"]
    path = "C:/Program Files (x86)/Beyond Compare 3/BComp.exe"

[merge]
    tool = bc3

[mergetool "bc3"]
    keepTemporaries = false
    trustExitCode = true
    keepBackup = false
    path = "C:/Program Files (x86)/Beyond Compare 3/BComp.exe"

Solution

  • There is a solution described here. Basically, if you modify your .gitconfig to use BCompare.exe instead of BComp.exe, the console session will remain open until the Beyond Compare window is closed.

    Modify your .gitconfig settings to read:

    # External Visual Diff/Merge Tool
    [diff]
        tool = bc3
    
    [difftool "bc3"]
        path = "C:/Program Files (x86)/Beyond Compare 3/BCompare.exe"