我怎样才能“强迫”树干上的树枝,万一我无法“重新融入”呢?
我们从主干创建了一个分支,并在其上进行了重大重构。与此同时,主干进行了一些修改并修复了一些问题。我们不希望在分支上进行这些更改,因此我们不想“赶上”将主干合并到分支,因为我们不想混合新旧代码。但如果没有这个,我无法将分支重新整合回主干。
有没有办法将分支“按原样”强加在主干上?
(我考虑的一个想法是撤消(“反向合并”)主干回到分支开始的修订版本,然后可以安全地将其合并到分支上 - 应该不会发生任何事情。然后我可以重新集成。你觉得怎么样?)
We created a branch from the trunk on which a major refactoring was done. Meanwhile, the trunk advanced a few revisions with some fixes. We don't want these changes on the branch, so we don't want to "catch-up" merge the trunk to the branch, because we don't want to mix the old and new code. But without this I can't reintegrate the branch back to the trunk.
Is there a way to impose the branch on the trunk "as-is"?
(An idea I considered is to undo ("reverse-merge") the trunk back to the revision where the branch started, and then it is safe to merge it on branch - nothing should happen. Then I can reintegrate. What do you think?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您可以很好地丢失这些更改,那么这是一个可以接受的解决方案,尽管您可能需要考虑简单地将当前主干重命名为分支并将分支重命名为主干:
尽管如此,您真的确定不想将在后备箱的变化中?您可能需要非常仔细地考虑这一点。即使您已经进行了大量重构,如果主干上的可用工作已经完成,您仍然可能需要非常仔细地查看它,以免所取得的进展被浪费。
Assuming that you are fine losing those changes then that is an acceptable solution, although you might want to consider simply renaming the current trunk to a branch and renaming the branch to trunk:
Although, are you really sure that you don't want to bring in the changes from trunk? You might want to consider that very carefully. Even if you have done lots of refactoring, if usable work on trunk has been made, you still might want to look at it very carefully so that the progress made doesn't go to waste.
正如您提到的,您可以使用反向合并。签出主干
这将撤消您在创建分支后所做的所有更改。之后合并应该可以顺利进行。
更新:
^/trunk
仅适用于 Linux。在 Windows 上,您需要^^/trunk
。You can use, as you mentioned the reverse merge. Checkout the trunk
This will undo all changes you've made after the branch has been created. After that the merging should be working without any problems.
Update:
^/trunk
will only work on Linux. On Windows you need^^/trunk
instead.