In ubuntu (linux), svn uses the kdiff3merge trunk

Source: Internet
Author: User
In linux, TortoiseSVN cannot be used. idea cannot use the svnmerge main code. the virtual machine is started every time the merge code is run. The following method can be used to operate merge code like TortoiseSVN.

In linux, the turtle (TortoiseSVN) cannot be used, and the idea cannot use the svn merge trunk code. the virtual machine is started every time the merge code is run.

The following method can be used to operate merge code like TortoiseSVN:


1. install kdiff3. Cross-system and popular code diff tools.

Sudo apt-get install kdiff3

2. install the svn tool.

1) sudo apt-get install subversion-tools

2) downgrade to install svn (1.7). For details, refer to: KUbuntu/Ubuntu 14.04 (downgrade) to install svn 1.7.

3. configure the script.

1. download svndiffwrapper.txt. Http://download.csdn.net/detail/love254443233/7941913

2) copy: sudo cp svndiffwrapper.txt/usr/bin/svndiffwrapper

3) set the running permission. Sudo chmod a + x/usr/bin/svndiffwrapper

4. modify svn configuration information

1) open the configuration file: vim ~ /. Subversion/config

2) modify the diff tool and merge-tool-cmd tool configuration

### Set diff-cmd to the absolute path of your 'diff' program.###   This will override the compile-time default, which is to use###   Subversion's internal diff implementation.# diff-cmd = diff_program (diff, gdiff, etc.)diff-cmd = svndiffwrapper### Set diff3-cmd to the absolute path of your 'diff3' program.###   This will override the compile-time default, which is to use###   Subversion's internal diff3 implementation.# diff3-cmd = diff3_program (diff3, gdiff3, etc.)diff3-cmd = svndiffwrapper### Set diff3-has-program-arg to 'yes' if your 'diff3' program###   accepts the '--diff-program' option.# diff3-has-program-arg = [yes | no]### Set merge-tool-cmd to the command used to invoke your external### merging tool of choice. Subversion will pass 4 arguments to### the specified command: base theirs mine merged# merge-tool-cmd = merge_commandmerge-tool-cmd =Kdiff3 "$1" "$2" "$3" -o "$4"
5. merge trunk.

1) run the command line to enter the working directory of the local branch, such as/home/xx/work/svn/xx-hotel-image.

Submit the branch (to prevent exceptions ). Svn commit-m "merge trunk"

2) copy the trunk (trunk) url, such as http://svn.xx.xx.com/svn/xx/xx/xx-api/trunk

3) merge code (the last "." can be omitted because Step 1 is operated ).

Svn merge http://svn.corp.qunar.com/svn/mobile/mobfx/hms-api/trunk.

4) a message is displayed when a conflict occurs during running:

What wocould you like to do?
[M] erge [A] ccept [I] gnore [R] evert [D] efault [H] elp

Select (M) erge to go to the kdiff3 interface, which is roughly the same as using TortoiseSVN in windows for merge.

Appendix:

1. interface operation method

1) The first column is the version file created by the branch. The second column is the file being developed by the branch. The third column is the trunk file. The following column lists the output files after comparison ).

2) the output file can be edited and can be manually modified if it cannot meet merge's needs.

2. other common svn merge commands

1) merge trunk to local branch: svn merge http://svn.xx.xx.com/svn/xx/xx/xx-api/trunk.
2) use rollback when a merge error occurs:

Svn revert-cancel all local edits. To restore an entire directory, you can use the -- depth = infinity option:
Svn revert -- depth = infinity.

3) submit local modifications to the server:

Svn commit-m "merge trunk"

4) the following error occurs:

Svn: E155015: submission failed (details are as follows ):
Svn: E155015: submission termination: "/home/xx/work/svn/xx-hotel-image/versions. mapping" is in conflict state

Solution: svn resolved/home/xx/work/svn/xx-hotel-image/versions. mapping

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.