Use Beyond compare in Ubuntu command line SVN for comparison and merge tools

Source: Internet
Author: User

If you use Svn in Ubuntu, you should know that the default diff tool is quite difficult to use. Although colordiff can be used to replace diff, it is better to use bcompare. Can we use beyond compare as its default comparison tool? Of course!

1. Download and install beyond compare. You can download the Linux version from the following website:

Http://www.scootersoftware.com/download.php

2. Install SVN

3. Go to the. Subversion folder and create two new. Sh files.

Bc2.sh

#!/bin/sh# Configure your favorite diff program here.DIFF=bcompare# Subversion provides the paths we need as the sixth and seventh # parameters.LEFT=${6}RIGHT=${7}# Call the diff command (change the following line to make sense for# your merge program).$DIFF --left $LEFT --right $RIGHT# Return an errorcode of 0 if no differences were detected, 1 if some were.# Any other errorcode will be treated as fatal.

Bc3.sh

#!/bin/sh# Configure your favorite diff3/merge program here.DIFF3=bcompare# Subversion provides the paths we need as the ninth, tenth, and eleventh # parameters.MINE=${9}OLDER=${10}YOURS=${11}# Call the merge command (change the following line to make sense for# your merge program).$DIFF3 --older $OLDER --mine $MINE --yours $YOURS# After performing the merge, this script needs to print the contents# of the merged file to stdout.  Do that in whatever way you see fit.# Return an errorcode of 0 on successful merge, 1 if unresolved conflicts# remain in the result.  Any other errorcode will be treated as fatal.

Change the two batch files to the executable status.

4. Modify the. Subversion/config file.

Add the following two sentences to [helpers ]:

Diff-cmd =/home/XXX/. Subversion/bc2.sh
Diff3-cmd =/home/XXX/. Subversion/bc3.sh

OK

Of course, you can also change bcompare to another comparison tool, such as meld.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.