从分支分支:移动到普通分支
我通常从主干创建分支,对其进行处理,并最终将它们重新集成回主干。
有时我会从另一个分支 X 创建一个分支 Y,这样我就可以从 X 的代码开始。通常我会先将Y重新集成到X中,然后将X重新集成到主干中。
Y --> X --> trunk
但是如果我想先将X重新集成到主干中,并且我不再希望Y依赖于X怎么办?换句话说,我希望Y成为一个普通分支,这样我就可以直接将它合并到主干或从主干合并,而不需要经过X。
Y --> trunk
X --> trunk
我该怎么办?一种方法是创建一个新分支,并将 Y 的所有更改合并到其中。但如果可能的话,我想继续使用 Y,这样我就不会忘记它的历史。这可能吗?
I normally create branches from trunk, work on them, and eventually reintegrate them back into trunk.
Sometimes I'll create a branch Y from another branch X, so I can start with X's code. Normally I'll reintegrate Y into X first, then reintegrate X into trunk.
Y --> X --> trunk
But what if I want to reintegrate X into trunk first, and I no longer want Y to depend on X? In other words, I want Y to be a normal branch, so that I can merge it directly to and from trunk, without going through X.
Y --> trunk
X --> trunk
What should I do? One approach would be to create a new branch, and merge all of Y's changes into it. But I'd like to keep using Y if possible, so I don't lose track of its history. Is that possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Subversion 不跟踪分支之间的任何依赖关系。它只保留历史和合并的历史。
当您将 Y 合并到 X 时,svn 会插入有关刚刚发生的合并的信息。当您将 X 合并回主干时,此信息将传播到主干。这样,更改就不会在后续合并中应用两次。不管这些合并是如何进行的。
您应该将 X 合并到主干中,然后像 X 从未存在一样使用 Y。如果您愿意,可以合并到主干,或者无论您愿意,都可以继续工作。
在 svn 中分支没有依赖关系或任何东西。
Subversion does not track any dependencies between branches. It only keeps the history and the history of merges.
When you merge Y to X svn inserts the information about the merge that just happened. When you merge X back to trunk, this information is propagated to trunk. This way, a change will never be applied twice on consequent merges. No matter how these merges were made.
You should just merge X into trunk, and then work with Y like X never existed. Merge in to trunk if you want or just keep working on it whether you want.
In svn branches have no dependencies or whatsoever.