pythongitdifftooldiffmerge

Git difftool not working Windows 10 Git Bash


I installed diffmerge and pasted this into my .gitconfig file in my C:/Users folder.

[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe\"$LOCAL\" \"$REMOTE\"

[merge]
    tool = diffmerge
[mergetool "diffmerge"]
    trustExitCode = true
    cmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe-merge -result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"

But now when I use difftool in git bash I get this

/mingw64/libexec/git-core/git-mergetool--lib: line 128: C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exeC:\Users\Anas\AppData\Local\Temp/hhqGyv_calc.py: No such file or directory
fatal: external diff died, stopping at calc.py

Solution

  • The reason I got this problem was I didn't leave a space after sdgm.exe in two different places.

    First one is in line number 4 where I wrote sdgm.exe\"LOCAL\" instead it was supposed to be

    sdgm.exe \"LOCAL\".

    And the second one is in line number 10 where I wrote sdgm.exe-merge instead it was supposed to be

    sdgm.exe -merge

    Thank You @ElpieKay and @quamrana for helping me.