解决树冲突

如何解决当前场景中的树冲突。

C:\DevBranch
C:\MyBranch

我更新了两家分行的信息。编辑了 MyBranch 然后又回来了。现在要将这些更改合并到 DevBranch 中。当我进行合并时,我得到了“树冲突”

The last merge operation tried to add the file 'abc.def', but it was already added locally.


How do you want to resolve this conflict?
Keep the file from repository
Keep the local file

我该怎么解决?

175728 次浏览

What you can do to resolve your conflict is

svn resolve --accept working -R <path>

where <path> is where you have your conflict (can be the root of your repo).

Explanations:

  • resolve asks svn to resolve the conflict
  • accept working specifies to keep your working files
  • -R stands for recursive

Hope this helps.

EDIT:

To sum up what was said in the comments below:

  • <path> should be the directory in conflict (C:\DevBranch\ in the case of the OP)
  • it's likely that the origin of the conflict is
    • either the use of the svn switch command
    • or having checked the Switch working copy to new branch/tag option at branch creation
  • more information about conflicts can be found in the dedicated section of Tortoise's documentation.
  • to be able to run the command, you should have the CLI tools installed together with Tortoise:

Command line client tools

Basically, tree conflicts arise if there is some restructure in the folder structure on the branch. You need to delete the conflict folder and use svn cleanup once. Hope this solves your conflict.