How to add Devart's Code Compare as custom diff & merge tool within Sourcetree?
I modified my C:\Users\[User Name]\.gitconfig
file by adding this like Alex suggested:
[difftool "codecompare"]
cmd = 'C:\\Program Files\\Devart\\Code Compare\\codecompare.exe' -W \"$LOCAL\" \"$REMOTE\"
renames = true
[diff]
tool = codecompare
guitool = codecompare
[mergetool "codecompare"]
cmd = 'C:\\Program Files\\Devart\\Code Compare\\codemerge.exe' -MF=\"$LOCAL\" -TF=\"$REMOTE\" -BF=\"$BASE\" -RF=\"$MERGED\"
trustExitCode = true
[mergetool]
keepBackup = false
[merge]
tool = codecompare
guitool = codecompare
Then I changed my SourceTree Tools -> Options -> Diff
to System Default.
After that my Code Compare
started running correctly inside Visual Studio which is awesome.
Hope it helps!
Code compare integration with source control systems
To integrate Code Compare with Sourcetree add the following lines to the c:\Users\[User Name]\.gitconfig
file:
[difftool "codecompare"]
cmd = 'C:\\Program Files\\Devart\\Code Compare\\codecompare.exe' -W \"$LOCAL\" \"$REMOTE\"
renames = true
[diff]
tool = codecompare
guitool = codecompare
[mergetool "codecompare"]
cmd = 'C:\\Program Files\\Devart\\Code Compare\\codemerge.exe' -MF=\"$LOCAL\" -TF=\"$REMOTE\" -BF=\"$BASE\" -RF=\"$MERGED\"
trustExitCode = true
[mergetool]
keepBackup = false
[merge]
tool = codecompare
guitool = codecompare
Now git difftool will work properly from both command line and Sourcetree.
Note: you need select 'System Default' option in Sourcetree options.
Git Integration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With