How does SVN resolve conflicts on linux?

Source: Internet
Author: User

Engineer a revised the first line of a.txt and submitted it.
Engineer B also revised the first line of a.txt and then executed svn up. SVN prompts: (below, you started to assume the role of engineer B)
$ Svn up
A conflict is found in cmda.txt.
Select: (p) postponed, (df) show all differences, (e) edit,
(Mc) My version, (tc) others' version,
(S) show all options:

I usually choose p (postponed), that is, the introduction of conflicts to the local, but it does not affect the SVN server, you can rest assured.

OK.

Several files are generated:

A.txt. mine a.txt. r6328 a.txt. r6336

A.txt contains all the modifications made by engineer A and engineer B, which are separated by <<<<<<=====, >>>>>>>.

A.txt.mineis the revision of engineer B, and a.txt is not before update.

A.txt. r6328 is the version submitted by engineer A, that is, the version that does not cause conflict.

A.txt. r6336 is the version submitted by engineer A, which leads to conflicting versions.

In general, the details of the conflict can be seen in example a.txt:

[Yicheng @ chengyi svntest] $ cat a.txt

<. Mine

I also modify, agndagnagasdg;

========

I modify this line;

>>>>>>>. R6336

Above, <. mine and ======== are the modified content of engineer B (current "you"), ============>>>>>>>. r6336 was modified by engineer. In this case, it is best to call engineer A to determine whether all the modifications are required and compatible with each other, and then leave the necessary parts and delete them. <. mine, ========and >>>>>>>. r6336.

Then, test and test! After confirming that there is no problem, you can tell SVN that you have resolved the conflict:

Svn resolve-accept working a.txt (this command will delete a.txt. mine a.txt. r6328 a.txt. r6336)

Svn ci-m'some comment' a.txt

Here, the.txt. mine a.txt. r6328 a.txt. r6336 files are generated in conflict. If you do not resolve the conflicts, delete them manually. The SVN server will also think that you have resolved the conflicts and will allow you to continue the subsequent work. However, conflicts exist. Your a.txt contains not only the modifications made by others, but also the annoying <=> symbols.

Before the conflict is resolved, the attempt to submit code will certainly fail:

$ Svn ci-m"

Svn: submission failed (details are as follows ):

Svn: Submit and terminate: "/path/to/svntest/a.txt" is in conflict

When svn update is used, the following information is displayed:
$ Svn update
U INSTALL
G README
C bar. c
Updated to revision 46.

The information starting with U prompts you that the file has not been modified locally and has been updated according to the new version of the version library. The information starting with G prompts you that the file has been modified locally, but it does not conflict with the version in the version library. svn has been merged and updated. The information starting with C prompts you that this file is a little troublesome. Your local modification overlaps with the version modification in the version library. That is to say, you modified a line, your colleague also modified the same line. You need to solve this problem manually. When a conflict occurs, you must note that three things can help you solve the problem.

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.