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

5

9

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

Benedikta answered 30/1, 2015 at 9:29 Comment(1)
I take it Code Compare is not one of the built-in options for setting an external merge tool the way Beyond Compare is.Zanze
M
19

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

Michale answered 11/8, 2015 at 17:48 Comment(0)
C
8

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"

teste

Calhoun answered 22/12, 2016 at 13:45 Comment(2)
I have not delved into it but according to Devart it should be -W "$LOCAL" "$REMOTE" for CodeCompare.exeGasparo
LosManos is right... it should have a -W in front of the "Diff Command" arguments.Gentianella
C
2

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

Calhoun answered 2/7, 2015 at 17:50 Comment(1)
Couldn't get this working until I saw your note about setting Sourcetree's option to "System Default", thanks.Malvern
G
0

What worked for me: Win10, SourceTree 2.1.110, Code Compare 4.2.236

  • SourceTree>Tools>Options>External Diff
  • Diff: Tool->Custom;
    • Command: c:\Program Files\Devart\Code Compare\CodeCompare.exe
    • Arg: $LOCAL $REMOTE
  • Merge: Tool->Custom
    • Command: c:\Program Files\Devart\Code Compare\CodeMerge.exe
    • Arg: -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

Gorga answered 7/9, 2017 at 11:35 Comment(0)
A
-1

Check Devart Code Compare help file section on 'Version Control System Integration'. There is a topic for GIT.

Agreement answered 5/3, 2015 at 14:15 Comment(1)
While this may answer the question, it is better to include the essential parts of the answer here and provide the link for reference.Hodgkins

© 2022 - 2024 — McMap. All rights reserved.