I really like Devart's CodeCompare and its excellent integration with Visual Studio. However, these days I do development in VSCode under WSL2. VSCode has a pretty decent diff and merge tool but it cannot be compared to CodeCompare (no pun intended). I really want to use CodeCompare from VSCode (Devart please look into it - this is the most popular dev.environment these days) or just from the good ole Linux git CLI.
Asked
Active
Viewed 217 times
1 Answers
0
This is what I came up with. If someone has a better suggestion (this one is a little slow), please share it. So, I added these lines to my ~/.gitconfig:
[diff]
tool = codecompare
guitool = codecompare
[difftool "codecompare"]
cmd = \"${ProgramFilesW64}/Devart/Code Compare/CodeCompare.exe\" /SC=git /ENVIRONMENT=standalone /W /T1="ours" /T2="theirs" \"$(wslpath -w $LOCAL)\" \"$(wslpath -w $REMOTE)\"
renames = true
[merge]
tool = codecompare
guitool = codecompare
[mergetool "codecompare"]
cmd = \"${ProgramFilesW64}/Devart/Code Compare/CodeMerge.exe\" /SC=git /ENVIRONMENT=standalone /MF=\"`wslpath -m $LOCAL`\" /TF=\"`wslpath -m $REMOTE`\" /BF=\"`wslpath -m $BASE`\" /RF=\"`wslpath -m $MERGED`\" /MT="ours-HEAD" /TT="theirs" /RT="result" /BT="base"
trustExitCode = true
[mergetool]
keepBackup = false

Valo
- 1,872
- 2
- 15
- 23
-
In your setup, the CodeCompare's path may be different, e.g. `/mnt/c/Program Files/Devart/Code Compare/codecompare.exe` – Valo Jul 19 '20 at 21:29