SVN version Conflict resolution-snwrking's column-Blog channel-csdn.net

Source: Internet
Author: User
Tags tortoisesvn

Version Conflict Reason:

Suppose A, b two users are in the version number 100, the update kingtuns.txt this file, a user after the modification is completed to submit kingtuns.txt to the server, this time the submission is successful, this time Kingtuns.txt file version number has become 101. At the same time, B users in the version number 100 Kingtuns.txt file modification, when the modification is submitted to the server, because it is not in the current version of the latest 101 changes, resulting in the submission failed.

Version Conflict Behavior:

When a conflict occurs, Subversion saves all target file versions in the current working directory [the last updated version, the currently acquired version (that is, the version submitted by someone else), its own updated version, and the target file].

Assume that the file name is Kingtuns.txt

The corresponding filenames are:

Kingtuns.txt.r101

kingtuns.txt.r102

Kingtuns.txt.mine

Kingtuns.txt. Also mark changes from different users in the destination file.

Version Conflict Resolution:

Scene:

1, now A, b two users are updated Kingtuns.txt files to local.

2. The contents of the original document are as follows:

3, a user to modify the file, add content "A user modified content" after the completion of submission to the server

4, B user Modify the file, add the content "B user Modified content" after the completion of submission to the server

b users are prompted as follows when submitting updates to the server:

b When the user submits the file to the server, it prompts the version to expire: You should first update the version from the repository, then resolve the conflict, perform the SVN resolved (resolution) after the conflict is resolved, and then check in to the repository. After the conflict is resolved, you need to use SVN resolved (resolution) to tell the Subversion conflict resolution so that the update can be submitted.

There are three options for resolving conflicts:

A, discard your updates, use SVN revert (rollback), and then submit. In this way you do not need to use SVN resolved (fix)

B. Discard your updates and use someone else's updates. Overwrite the target file with the newly acquired version, execute resolved filename and submit (select File-right-click-Resolve).

C, manual resolution: When a conflict occurs, manually update the target file after communicating with other users. The resolved filename is then executed to remove the conflict and finally commit.

The steps to resolve are as follows:

1. Perform an "update" operation in the current directory

2. On the conflicting file (select File-Right-click menu-tortoisesvn-edit Conflicts (resolve conflict)), the following window appears

Theirs window is currently the latest version on the server

The mine window is a locally modified version

The merged window is displayed for the merged file contents

3, if you want to use the server version, in the theirs window to select the difference, right-click, select the use of this text block (using this paragraph).

Similarly, if you want to use the local version, after negotiation, right-click in the Mine window and select Use this text block.

4, after the completion of the modification, save kingtuns.txt file contents.

5, in the conflict directory of the B user, select File-right-click menu-tortoisesvn-resolved (Resolve). A list of conflicting files is listed, and if confirmation has been resolved, click OK.

6. Conflict resolution

7. Submit post-conflict resolution documents.

How to reduce the complexity of conflict resolution:

1. When the document is edited and submitted as soon as possible, frequent commits/updates can reduce the probability of conflict occurrence and the complexity of resolving conflicts when they occur.

2, in the submission, write a clear message, convenient to find the reason for the user update, after all, with the passage of time, the reason for the original update may be forgotten

3, develop good usage habits, use SVN each time is first submitted, after the update. After opening every morning, first get the latest version from the repository. Documents that have already been edited must be submitted to the repository every day before they leave work.



From for notes (Wiz)

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.