Search code examples
gitmsysgitmsys

Windows git difftool cannot parse extcmd path with spaces


In Windows, from the Git MSYS command line, I would like to run this command:

git difftool --extcmd=/C/Program Files/Beyond Compare 4/Bcomp.exe -- file_to_diff.ext

I'm struggling to have the extcmd parameter parsed correctly.


Solution

  • I found the correct way to write the command:

     git difftool -y --extcmd="'/C/Program Files/Beyond Compare 4/BComp.exe'" -- file_to_diff.ext
    

    Notice the double quotes followed by single quotes.