2012-09-24 101 views
74

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

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 

我该如何解决?

回答

149

你能做些什么来解决您的冲突是

svn resolve --accept working -R <path> 

其中<path>是你有你的冲突(可以是你的回购的根目录)。

说明:

  • resolve要求svn解决冲突
  • accept working指定要保持你的工作文件
  • -R代表递归

希望这有助于。

编辑:

要总结一下在下面的评论中说:

  • <path>应该是(在OP的情况下C:\DevBranch\)在冲突目录
  • 很可能冲突的起因是
    • 要么使用svn switch com普通话
    • 或检查过Switch working copy to new branch/tag选项在分支创建
  • 更多有关冲突可以在dedicated section of Tortoise's documentation找到。
  • 能够运行命令,你应该有龟一起安装CLI工具:

Command line client tools

+0

应该是什么样的路径? C:\ DevBranch或C:\ MyBranch? – coure2011

+2

它应该是'C:\ DevBranch'。顺便说一句,你是否在这两个文件夹中的一个上使用'svn switch'命令? –

+0

不,我不知道切换命令 – coure2011