Reputation: 13078
How to add Devart's Code Compare as custom diff & merge tool within Sourcetree?
Upvotes: 9
Views: 5162
Reputation: 1440
What worked for me: Win10, SourceTree 2.1.110, Code Compare 4.2.236
c:\Program Files\Devart\Code Compare\CodeCompare.exe
$LOCAL $REMOTE
c:\Program Files\Devart\Code Compare\CodeMerge.exe
-MF=\"$LOCAL\" -TF=\"$REMOTE\" -BF=\"$BASE\" -RF=\"$MERGED\"
Keep in mind that 3-way merge is only available at Code-Compare PRO
https://www.devart.com/codecompare/featurematrix.html
Upvotes: 0
Reputation: 2802
In SourceTree open Tools > Options > Tab: Diff.
On panel External Diff / Merge put the following data:
External Diff Tool: Custom
Diff Command: C:/Program Files/Devart/Code Compare/CodeCompare.exe
Arguments: $LOCAL $REMOTE
Merge Tool: Custom
Merge Command: C:/Program Files/Devart/Code Compare/CodeMerge.exe
Arguments:-MF "$LOCAL" -TF "$REMOTE" -BF "$BASE" -RF "$MERGED"
Upvotes: 8
Reputation: 2802
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.
Upvotes: 2
Reputation: 44680
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
Upvotes: 19
Reputation: 9
Check Devart Code Compare help file section on 'Version Control System Integration'. There is a topic for GIT.
Upvotes: -1