使用 TortoiseSVN 重新集成分支不需要首先同步分支和主干吗?

发布于 2024-10-17 11:09:12 字数 385 浏览 3 评论 0原文

我以为我了解如何使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

删除→记忆 2024-10-24 11:09:12

在 TortoiseSVN 文档 中,关于“重新集成分支”合并选项,它说:

所有主干更改已每周移植到功能分支
一周,现在该功能已完成,您想将其合并回
树干。因为您已使功能分支与
trunk,最新版本的branch和trunk绝对会
除了您的分支更改之外,完全相同

我相信这是造成混乱的部分(它也让我困惑了一段时间),
但随后它说:

它使用 Subversion 的合并跟踪功能来计算
使用正确的修订范围,并执行额外的检查
确保分支已通过主干更改完全更新。这
确保您不会意外撤消其他人所做的工作
自上次同步更改以来已提交到主干。

根据文档中的第二个片段以及我自己的经验,我相信使用“重新集成分支”合并选项是安全的。我们使用这种方法重新集成我们的分支,并且我们的分支很少随着主干更改而更新(仅当主干中的修复修复了分支中的阻塞问题时)。

为了通过主干更改更新我们的分支,我们总是使用“合并一系列修订”。

In the TortoiseSVN documentation, in the part about the "Reintegrate a branch" merge option, it says:

All trunk changes have been ported to the feature branch, week by
week, and now the feature is complete you want to merge it back into
the trunk. Because you have kept the feature branch synchronized with
the trunk, the latest versions of branch and trunk will be absolutely
identical except for your branch changes

I believe this is the part that is causing the confusion (it confused me for a while too),
but then it says:

It uses the merge-tracking features of Subversion to calculate the
correct revision ranges to use, and perform additional checks which
ensure that the branch has been fully updated with trunk changes. This
ensures that you don't accidentally undo work that others have
committed to trunk since you last synchronized changes.

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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文