svn conflict problem solution

It is often said that tree conflict is a type of conflict that is difficult to resolve. In fact, once you understand its principles, it is not difficult to resolve. Let's review the definition of tree conflict first.

    Tree Conflicts: A tree conflict occurs when one developer moves, renames, deletes a file or folder and another developer moves, renames, deletes or simply modifies them.
When a conflict occurs, it is generally prompted what the conflicting information is. After that we can use svn st to view the current status. What do the various states of svn st represent, please refer to this blog post for a detailed explanation of the svn st state .
first introduce the concept

Delete : Where the directory structure changes, it is considered to be Delete

Edit: refers to modifying the file

Local : is your local modification

Incoming: someone else modified, you want to update or merge in.

There should be 4 combinations in this way, but the combination of Edit to Edit should be File Conflict, which is easy to solve and is not within the scope of Tree Conflict, so there are 3 combinations. Need to distinguish between Update and Merge, there are 6 situations. respectively

Local delete, incoming edit upon update
Local edit, incoming delete upon update
Local delete, incoming delete upon update
Local missing, incoming edit upon merge
Local edit, incoming delete upon merge
Local delete, incoming delete upon merge
These situations are explained as follows:
1.Local delete, incoming edit upon update
Cause: 1.A modifies the file Foo.c and submits it to the repository, B renames Foo.c to Bar.c or deletes Foo.c or directly deletes the parent directory Foo of Foo.c 2.B Updating the working copy will prompt the conflict, in the working copy it appears as Foo.c is deleted locally and is marked as a conflict. In the case of renaming, Bar.c is marked as new, but A's modifications are not included.
Solution: A and B need to confirm whether to adopt A's modification and whether to rename. If the modification of A is adopted and it needs to be renamed, after modification, mark the conflict resolution, svn resolved, and finally submit; if the modification of A is not adopted, just mark the conflict resolution submission directly.
2.Local edit, incoming delete upon update
Cause: 1.A renames Foo.c to Bar.c and submits it to the repository (or A modifies Foo.c's parent directory Foo to Bar), and B modifies Foo.c in his working copy . 2.B update before submitting, it will prompt such an error.
Solution: It also requires two people to modify it after consultation.
3.Local delete, incoming delete upon update
Cause: 1.A renames Foo.c to Bar.c and submits it, and B renames Foo.c to Bix.c. 2.B updating the local working copy will prompt the tree conflict.
Solution: Find the reason why the file is deleted or renamed through the log. After A and B negotiate, finally confirm which name to use.
4.Local missing, incoming edit upon merge
Causes: 1.A modifies Foo.c on the trunk, and B renames Foo.c to Bar.c on the branch. 2.B merges A's modifications on the trunk.
Solution: B first marks conflict resolution, then copies Foo.c to the local, merges A's modifications into its own file, or directly abandons A's modifications and adopts its own modifications.
5.Local edit, incoming delete upon merge
Causes: 1.A renames Foo.c to Bar.c (or changes Foo.c's parent directory Foo to Bar), and B modifies Foo.c on the branch. 2. The conflict is prompted when B merges A's modifications. Bar.c is marked for increase and Foo.c is marked for conflict.
Solution: The source of the modification was also found according to the log, and the two negotiated the solution.
6.Local delete, incoming delete upon merge
Cause: 1.A renames Foo.c to Bar.c on the trunk, and B renames Foo.c to Bix.c on the branch. 2. When B merges A's modifications, a conflict will be prompted. The renamed file is marked as new and the original file is marked as tree conflict.
Solution: Find the moment when the file was renamed through the log, and resolve it after negotiation between the two.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324765201&siteId=291194637