SVN - 无法将分支合并回主干 - 大量的树冲突 [英] SVN - unable to merge branch back into trunk - numerous tree-conflicts

查看:26
本文介绍了SVN - 无法将分支合并回主干 - 大量的树冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我认为很简单的场景 - 使用 TortoiseSVN:

I have what I thought was a simple scenario - using TortoiseSVN:

1) 我创建了一个应用程序的分支 (B2)(用于实现图像精灵和 JAWR).

1) I made a branch (B2) of an application (to work on implementing image sprites & JAWR).

2) 测试 &后备箱上的开发照常进行.

2) Testing & development went on as normal on the trunk.

3) 在过去的几天里,我通过以下方式重新建立了分支的基础:

3) I re-based the branch a couple of times over the last few days by:

3.1) 将主干(按修订范围)合并到我的 branch-b2 工作副本,解决合并期间的冲突.

3.1) Merged trunk (by range of revisions) to my branch-b2 working copy, resolving conflicts during the merge.

3.2)(在测试分支 b2 之后),我提交了重新基于分支的分支 b2.

3.2) (after testing branch-b2), I commit the re-based branch-b2.

这一切都如我所料.但是将分支合并回主干对我来说是可行的:

This all worked as I expected. But merging the branch back into the trunk is having its way with me:

4) 在 branch-b2 提交所有更新之后;我确保我对主干和分支 b2 进行了 SVN 更新.

4) After all updates committed in branch-b2; I make sure I do an SVN Update on trunk and branch-b2.

5) 然后,我尝试将分支 b2 中的(修订范围)合并到主干中.但是,对于任何已添加到主干并随后在我重新定位它时添加到 branch-b2 的新文件,我都会遇到树冲突.我不确定解决这些冲突的正确方法是什么.

5) Then, I try to merge (range of revisions) from branch-b2 into the trunk. However, for any new file that had been added to the trunk, and subsequently added to branch-b2 when I rebased it, I get a tree-conflict. I'm not sure what the proper way is to resolve these conflicts.

我见过的最典型的建议是从主干中删除树冲突文件,然后合并分支;或者删除整个主干,将分支文件复制过来,然后将它们作为新版本提交到主干中.这两个选项似乎都不是一个好主意 - 第一个很痛苦,而且它们似乎都会丢失文件修订历史记录.

The most typical advice I've seen is to either delete the tree-conflict files from the trunk, then merge the branch over; or delete the entire trunk, copy the branch files over, and then commit them as a new version in the trunk. Neither of those options seems like a good idea- first one is a pain, and both seem like they would lose file revision histories.

我做错了什么,我该如何解决?

What'd I do wrong, and how do I fix it?

推荐答案

听起来您正在使用 1.5 之前的合并样式并尝试将分支重新集成到主干中.在这种情况下,您要做的是首先确保所有主干更改都已合并到分支中,然后不是将分支范围合并到指向主干的工作副本,而是要合并FROM trunk@HEAD TO branch@HEAD",工作副本指向主干.本质上:

Sounds like you're using the pre-1.5 merge style and trying to reintegrate the branch into trunk. In that case, what you want to do is first ensure all the trunk changes have been merged in to the branch, and then instead of range-merging the branch to a working copy that points to the trunk, you want to merge "FROM trunk@HEAD TO branch@HEAD" with the working copy pointing to trunk. In essence:

给我我需要的所有更改,使主干与分支相同".

"Give me all the changes I'd need to make trunk identical to branch".

如果您已经将所有主干更改合并到分支,则此方法有效,因为主干和分支之间的唯一区别是在分支中所做的更改.

This works if you've already merged all the trunk changes to the branch, because then the only difference between trunk and branch are the changes made in the branch.

有意义吗?:)

这篇关于SVN - 无法将分支合并回主干 - 大量的树冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆