Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Devart's Code Compare as custom diff & merge tool in Sourcetree?

How to add Devart's Code Compare as custom diff & merge tool within Sourcetree?

like image 930
Daniel Gartmann Avatar asked Jan 30 '15 09:01

Daniel Gartmann


2 Answers

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

like image 132
Andrei Avatar answered Nov 19 '22 19:11

Andrei


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

like image 27
Alexandre N. Avatar answered Nov 19 '22 21:11

Alexandre N.