sdive
sdive

Reputation: 2177

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.

Upvotes: 1

Views: 740

Answers (2)

Frank
Frank

Reputation: 1

Unfortunately this only works with the first parameter. Subsequent parameters, the ' is removed when displayed, but it is still cut off from the space.

Unfortunately I haven't found a solution anywhere else.

git difftool --extcmd="'/C/Program Files/TortoiseGit/bin/TortoiseGitMerge.exe' /base:$LOCAL /mine:$REMOTE /basename:HEAD /minename:'xx yyyy'" --no-prompt "C:\......file-in-repo"

git difftool --extcmd="'/C/Program Files/TortoiseGit/bin/TortoiseGitMerge.exe' /base:$LOCAL /mine:$REMOTE /basename:HEAD '/minename:xx yyyy'" --no-prompt "C:\......file-in-repo"

Also, /minename: cannot contain round brackets.

Upvotes: 0

sdive
sdive

Reputation: 2177

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.

Upvotes: 3

Related Questions