问题描述
功能分支合并(重新集成)回主干后是否必须删除?
Must a feature branch be deleted after it's merged (reintegrated) back to trunk?
我更喜欢不断地从功能分支来回合并更改-我相信这会将冲突降到最低.但是我知道,一旦您使用重新整合合并到主干,就应该删除功能分支.
I prefer to constantly merge changes back and forth from my feature branch - I believe this keeps the conflicts to a minimum. Yet I understand that once you use the reintegrate merge to trunk, a feature branch should be deleted.
是吗?为什么?我该怎么做才能避免这种情况?
Is it so? Why? What can I do to circumvent this?
更新我在问的是该工具带来的技术问题,而不是方法论方面的问题".合并后,我打算继续处理功能分支.
UpdateI'm asking about technical problems that come from the tool, not "methodology concerns". I intend to keep working on the feature branch after the merge.
更新,最上面的答案确实指定了一个相当复杂的过程(合并,删除和重新分支).在TortoiseSVN中有一种简单的方法可以完成此操作吗?不应该吗?
Update the top answer indeed specifies a rather complex procedure (merge, delete & rebranch). Is there an easy way to accomplish this in TortoiseSVN? Shouldn't there be?
推荐答案
编辑:此问题似乎已在SVN 1.8中修复. 有关SVN 1.8书中的基本合并的部分已更新为:可以重用功能分支.以下答案仅与旧版SVN有关.
edit: This problem appears to have been fixed in SVN 1.8. The section on basic merging from the SVN 1.8 book has been updated to say that it is OK to reuse a feature branch. The answer below is only relevant for older SVN versions.
摘录自基本合并 svn书:
在SVN 1.6和1.7中仍然如此.
This is still the case in SVN 1.6 and 1.7.
这篇关于反思性合并的优秀文章解释了为什么确切地说,您不能或不应该回收功能分支.最重要的要点总结:
This excellent article on reflective merges explains why exactly you can't or shouldn't recycle a feature branch. Summary of the most important points:
- 您可以努力解决冲突与行李箱重新整合时
- 重新整合在主干中的提交因此包含两个变化来自功能分支和解决冲突的工作
- 但是,颠覆对您没有帮助合并此冲突解决工作回到功能分支.它只是看着mergeinfo并认为这些变化最初来自功能分支,无需合并他们又回到了他们的起源."
- you may do work to resolve conflictswhen reintegrating with the trunk
- The reintegration commit in trunktherefore contains both changescoming from the feature branch andconflict resolution work
- However, subversion will not help youmerge this conflict resolution workback to the feature branch. It simplylooks at the mergeinfo and thinks"these changes originally came fromthe feature branch, no need to mergethem again to their origin".
删除功能分支和重新分支很便宜,并且可以避免整个问题.
Deleting the feature branch and rebranching is cheap and avoids this whole issue.
这篇关于重新整合到主干后,使用Subversion功能分支是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!