SVN and TortoiseSVN Combat: conflict Details (II.)

Source: Internet
Author: User
Tags tortoisesvn

Hard canton: "SVN and TortoiseSVN Combat" series has written four, the second "SVN and TortoiseSVN Combat: Tags and branches" and the third "SVN and TortoiseSVN Combat: TortoiseSVN New and merged branch" This paper focuses on the concept of label and branch, and the actual operation demonstration, with a large number of followers.

The previous article referred to the knowledge of conflict, which already stated the 1th:

1. What is the situation that will cause conflict?

2. What is the meaning of the three documents generated when the conflict occurs?

3. How to use TortoiseSVN to resolve conflicts?

SVN is based on the same position at the same time the modification of the content to judge the conflict, this is the core point, the following explanation of 2, 3 points.

What is the meaning of the three files generated when the conflict occurs?

When you check out a file, there are three conflicting files that are generated when the modification of the local file conflicts with the changes that others have checked in, such as:

We right-click on the conflicting file and use TortoiseSVN's show log to view the modified log of the conflicting file:

To add, thesvn revision is based on the entire project, and unlike some version control programs that have their own revison,svn per file, each check-in is incremented, and a revision may contain modifications to multiple files.

Comparing this show log out of the logs, let's say the meaning of these three files:

Create a new text document. TXT.R96:96 is the version number, is the initial version of the change before you, that is, you are based on this version modified, if you revert this modification, the local will be returned to the content of this file;

Create a new text document. Txt.r97:97 is also the version number, which is the version that someone else has built before you check in.

Create a new text document. Txt.mine: Is the version you are prepared to commit, that is, the content of the new text document,. txt, which you modified before the conflict arose;

What is the content of the new text document,. txt, then?

Open to see that SVN has modified the file, using <<<<<<< >>>>>>> marked the conflict, based on the above understanding of three files, You should be able to easily understand the method of the SVN tag:

<<<<<<< between mine and ======= is the content you modify;

======= and >>>>>>> r97 are the most recent check-in content;

Use show log to view comments that others have checked in, decide whose code to take, and then remove the <<<<<, ======, >>>>>, and excess code to resolve the conflict.

Finally, I would emphasize that. mine represents its own modifications in SVN.

How do I use TORTOISESVN to resolve conflicts?

In fact, the way to understand the SVN tag, in the case of less conflict manual resolution is the most convenient.

The following demo right-click on the conflicting file, select the TortoiseSVN menu edit conficts, and use the TORTOISESVN tool to resolve the conflict:

After knowing the meaning of the three conflicting files, it is easy to understand what the above three areas mean:

The left side represents the modification of others, the right side is their own modification, the bottom is the merged content;

Red marked the line of conflict, in other people with their own conflict row in the selection of a row, right-click Use the this text block, resolved a row of conflicts.

You can also use the entire file to resolve the conflict, and right-click using this whole file.

After all the conflicts have been resolved, click on the Checkmark button on the top to resolve the previous three files disappear and check in your changes.

Say something extra.

Each check-in to the reasons for this modification and notes written in SVN's notes are good habits, when the conflict can be combined with notes to understand the reasons for the change, for Codereview personnel is also necessary.

SVN server can set the script, for non-write notes check-in refused check-in, the setting method can be self-Baidu.

record, for the better of myself!

SVN and TortoiseSVN Combat: conflict Details (II.)

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.