使用 TortoiseSVN 重新集成分支不需要首先同步分支和主干吗?
我以为我了解如何使用 TortoiseSVN 合并选项。我认为,如果自创建分支以来您没有从主干更新,您可以使用合并一系列修订,但如果您在某个时刻从主干更新了分支,那么您必须同步分支和主干,然后使用重新集成分支(或合并两棵不同的树)。
我还认为推论是,如果您没有从主干更新分支并且尝试使用重新集成分支,那么您将丢失自创建分支以来对主干的更改 - 也就是说,如果您不想同步这两个分支那么你必须使用合并一系列修订。
然而,我的一位同事说,他在所有情况下都使用重新集成分支而不会丢失任何东西。因此,我运行了一些测试,并且我必须同意,当您使用 TortoiseSVN“重新集成分支”从分支合并到工作副本时,您似乎不会丢失创建分支后提交的主干更改。主干,即使您没有首先将主干修订合并到您的分支中。这是对的吗?那么手册中的建议如何解释呢?
I thought I understood how to use the TortoiseSVN merge options. I thought that if you hadn't updated from trunk since the branch was created you could use merge a range of revisions, but if you had updated branch from trunk at some point then you had to synchronise branch and trunk then use either reintegrate a branch (or merge two different trees).
I also thought the corollary was that if you hadn't updated branch from trunk and you tried to use reintegrate a branch then you would lose changes to trunk since the branch was created - that is, if you didn't want to synchronise the two then you had to use merge a range of revisions.
However a colleague of mine says he uses reintegrate a branch in all cirstumstances without losing anything. So I've run a few tests, and I have to agree that you don't appear to lose changes to trunk committed after the creation of the branch when you merge using TortoiseSVN 'reintegrate a branch' from the branch to the working copy of trunk, even if you haven't merged the trunk revisions into your branch first. Is this right? What is the explanation for the advice in the manual then?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 TortoiseSVN 文档 中,关于“重新集成分支”合并选项,它说:
我相信这是造成混乱的部分(它也让我困惑了一段时间),
但随后它说:
根据文档中的第二个片段以及我自己的经验,我相信使用“重新集成分支”合并选项是安全的。我们使用这种方法重新集成我们的分支,并且我们的分支很少随着主干更改而更新(仅当主干中的修复修复了分支中的阻塞问题时)。
为了通过主干更改更新我们的分支,我们总是使用“合并一系列修订”。
In the TortoiseSVN documentation, in the part about the "Reintegrate a branch" merge option, it says:
I believe this is the part that is causing the confusion (it confused me for a while too),
but then it says:
Based on this second snippet from the document, and my own experience, I believe it is safe to use the "reintegrate a branch" merge option. We use this method for reintegrating our branches, and our branches are very rarely updated with trunk changes (only if a fix in the trunk fixes a blocking issue in the branch).
For updating our branches with trunk changes, we always use "merge a range of revisions".