(from:http://www.scootersoftware.com)
Beyond Compare can be configured as the external difference utility in many popular VCS applications. The following are configuration instructions for specific products. Let us know if you have one to add to the list.
Beyond Compare v3: These examples are based on Beyond Compare 3
Beyond Compare v2: To use Beyond Compare 2 replace BComp.exe
with BC2.exe
and change the path to Beyond Compare 2's install folder.
Compare
BComp.exe /readonly $(File1) $(File2)
2-way Merge
BComp.exe $(TrunkFile) $(BranchFile) /mergeoutput=$(ResultsFile)
3-way Merge (v3 Pro)
BComp.exe $(TrunkFile) $(BranchFile) $(AncestorFile) $(ResultsFile)
text_file_delta compare C:/Program Files/Beyond Compare 3/BComp.exe
text_file_delta xcompare C:/Program Files/Beyond Compare 3/BComp.exe
text_file_delta merge C:/Program Files/Beyond Compare 3/BComp.exe
text_file_delta xmerge C:/Program Files/Beyond Compare 3/BComp.exe
Make the same change to lines beginning with _html
, _xml
, _html2
, _xml2
to use Beyond Compare for HTML and XML comparisons.
To use Beyond Compare 2, only change the xcompare
line of the map file. Overriding compare
, merge
, and xmerge
is not supported. A helper that improves BC2's support is available here.
Visit Reliable Software for details on using Beyond Compare with Code Co-op. Reliable Software offers a discounted bundle of the two products.
CVS does not support external diff or merge tools.
BC version 3:
pvcsmerge.exe
and rename it to pvcsmerge.exe.exe
. bcomp.exe
from C:/Program Files/Beyond Compare 3
into the Dimensions folder and rename it to pvcsmerge.exe
. In Dimensions CM 10 you can edit your native.properties
file instead. The integration isn't as complete in that case, so file format/rules matching don't work correctly and folder comparisons aren't supported.
BC version 2:
Follow the instructions above, but instead of using BComp.exe
use the copy of pvcsmerge.exe
in pvcsmergev8.zip for PVCS 6.8, 8.0, and Merant Dimensions 8, or in pvcsmerge75.zip for PVCS 7.5.
Launch Beyond Compare from the Eclipse IDE using the Beyond CVS plug-in by Chris Callandar and Nick Boldt.
Diff
#!/bin/sh
# diff is called by git with 7 parameters:
# path old-file old-hex old-mode new-file new-hex new-mode
"" "$2" "$5" | cat
$ git config --global diff.external
3-Way Merge (v3 Pro)
In a console window enter the following three commands:
$ git config --global merge.tool bc3
$ git config --global mergetool.bc3.cmd "/usr/bin/bcompare /$LOCAL
/$REMOTE /$BASE /$MERGED"
$ git config --global mergetool.bc3.trustExitCode true
2-Way Merge (v3 Std, v2)
In a console window enter the following three commands:
$ git config --global merge.tool bc3
$ git config --global mergetool.bc3.cmd "/usr/bin/bcompare /$LOCAL
/$REMOTE -savetarget=/$MERGED"
$ git config --global mergetool.bc3.trustExitCode true
Note: If you use the Git for Windows' Bash Command Prompt instead of the default Windows Command Prompt, you need to escape the $
character with */$*
.
Diff
At a command prompt enter the commands:
git config --global diff.tool bc3
git config --global difftool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/""
git config --global difftool.prompt false
To launch a diff with BC3, use the command "git difftool foofile.txt".
3-Way Merge (v3 Pro)
At a command prompt, enter the commands:
git config --global merge.tool bc3
git config --global mergetool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/" /"$BASE/" /"$MERGED/""
git config --global mergetool.bc3.trustExitCode true
To launch a 3-way merge with BC3, use the command "git mergetool foofile.txt".
bcompare -readonly %1 %2
bcompare %s1 %s2 %t
bcompare %n %m %o %t
To configure Mercurial you need to edit the file %USERPROFILE%/Mercurial.ini
or $HOME/.hgrc
. Add the following lines, using existing INI sections if they already exist:
Diff
[extdiff]
cmd.bcomp = C:/Program Files/Beyond Compare 3/BCompare.exe
opts.bcomp = /ro
[tortoisehg]
vdiff = bcomp
Once set up you can compare revisions from the command line usinghg bcomp -r
3-Way Merge (v3 Pro)
[merge-tools]
bcomp.executable = C:/Program Files/Beyond Compare 3/BComp
bcomp.args = $local $other $base $output
bcomp.priority = 1
bcomp.premerge = True
bcomp.gui = True
[ui]
merge = bcomp
Diff
%1 %2 /title1=%6 /title2=%7
3-Way Merge (v3 Pro)
%1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9
2-Way Merge (v3 Std, v2)
Use the same steps as the 3-way merge above, but use the command line:%1 %2 /savetarget=%4 /title1=%6 /title2=%7
Supported for "Microsoft Visual SourceSafe" plug-in. The "Microsoft Visual SourceSafe (Internet)" plug-in does not support external diff tools.
"C:/Program Files/Beyond Compare 3/bcomp.exe" %1 %2
Diff
"C:/Program Files/Beyond Compare 3/BComp.exe" /title1="{1}" /title2="{2}" "{3}" "{4}"
3-Way Merge (v3 Pro)
Use this for the merge tool command line:
"C:/Program Files/Beyond Compare 3/BComp.exe" /title1="{1}" /title2="{2}" /title3="{0}" "{5}" "{6}" "{4}" "{7}"
2-Way Merge (v3 Std, v2)
Use this for the merge tool command line:
"C:/Program Files/Beyond Compare 3/BComp.exe" /title1="{1}" /title2="{2}" "{5}" "{6}" /savetarget="{7}"
P4V (The Perforce Visual Client)
%1 %2 %b %r
P4Win (The Perforce Windows Client)
/lefttitle="%L" /righttitle="%R" %1 %2
/vcsleft="%T" /vcsright="%Y" %2 %3 %1 %4
C:/Progra~1/Beyond~1/BComp.exe file1Name file2Name
ASSIGN Mexe = SEARCH("visdiff/visdiff.exe").
ASSIGN Mexe = SEARCH("C:/Progra~1/Beyond~1/bcomp.exe").
c:/program files/beyond compare 3/bcomp.exe
/readonly /title1="%FIRST_LABEL%" /title2="%SECOND_LABEL%" "%FIRST_FILE%" "%SECOND_FILE%"
"%FIRST_DIR%" "%SECOND_DIR%"
/leftreadonly /title1="%FIRST_LABEL%" /title2="%SECOND_LABEL%" "%FIRST_FILE%" "%SECOND_FILE%"
Diff
"%LEFT_PATH%" "%RIGHT_PATH%" /ro /title1="%LEFT_LABEL%" /title2="%RIGHT_LABEL%"
3-Way Merge (v3 Pro)
"%WORKING_PATH%" "%OTHER_PATH%" "%BASELINE_PATH%" "%DEST_PATH%" /title1="%WORKING_LABEL%" /title2="%OTHER_LABEL%" /title4="%DEST_LABEL%"
2-Way Merge (v3 Std, v2)
Use the same steps as above, but set the Arguments setting to:"%WORKING_PATH%" "%OTHER_PATH%" /title1="%WORKING_LABEL%" /title2="%OTHER_LABEL%" /savetarget="%DEST_PATH%"
Beyond Compare 1.9 is the default external difference utility in SourceOffsite Collaborative Edition. To upgrade to Beyond Compare 3 follow the instructions above.
Diff
$file1 $file2
3-Way Merge (v3 Pro)
$usertip $branchtip $basefile $resultfile
2-Way Merge is not supported because $resultfile is not expanded if used as an argument to /savetarget=.
Windows
"C:/Progra~1/Beyond~1/bcomp.exe" "%6" /title1=%3 "%7" /title2=%5
# [helpers]
# diff-cmd = diff_program (diff, gdiff, etc.)
[helpers]
diff-cmd = C:/Progra~1/Beyond~1/svn.bat
Cygwin (http://www.cygwin.com/)
Instead of using a batch file, create a file named "bc.sh" with the following line:"$(cygpath 'C:/Progra~1/Beyond~1/bcomp.exe')" `cygpath -w "$6"` `cygpath -w "$7"` /title1="$3" /title2="$5" /readonly
Linux
Diff:
Create a file named /usr/bin/bcdiff.sh with the following line:/usr/bin/bcompare "$6" "$7" -title1="$3" -title2="$5" -readonly
Edit "$HOME/.subversion/config" and add the line "diff-cmd = /usr/bin/bcdiff.sh".
Merge:
Create a file named /usr/bin/bcmerge.sh with the following line:/usr/bin/bcompare "$2" "$3" "$1" "$4"
Edit "$HOME/.subversion/config" and add the line "merge-tool-cmd = /usr/bin/bcmerge.sh".
Compare_cmd = C:/Progra~1/Beyond~1/bcomp.exe %file1 %file2 /lefttitle=%file1_label /righttitle=%file2_label
merge_cmd = C:/Program~1/Beyond~1/bcomp.exe %file1 %file2 %ancestor /mergeoutput=%outfile /lefttitle=%file1_label /righttitle=%file2_label
see Mercurial / HG
Diff
"C:/Program Files/Beyond Compare 3/BComp.exe" %base %mine /title1=%bname /title2=%yname /leftreadonly
To use Beyond Compare for image comparisons either replace the file C:/Program Files/TortoiseSVN/bin/TortoiseIDiff.exe with a copy of BComp.exe, or click the Advanced button on the Diff Viewer tab and add each image type's extension with the same command line as above.
3-Way Merge (v3 Pro)
"C:/Program Files/Beyond Compare 3/BComp.exe" %mine %theirs %base %merged /title1=%yname /title2=%tname /title3=%bname /title4=%mname
2-Way Merge (v3 Std, v2)
Use the same steps as above, but use the command line:"C:/Program Files/Beyond Compare 3/BComp.exe" %mine %theirs /savetarget=%merged
see SourceGear Vault / Fortress
Diff
"C:/Program Files/Beyond Compare 3/bcomp.exe" %1 %2
Merge
"C:/Program Files/Beyond Compare 3/bcomp.exe" %1 %2 /savetarget=%4
Visual SourceSafe 6.0 and earlier do not support external difference utilities. SourceOffsite and VersionMaster can both use Beyond Compare in combination with SourceSafe.