如何使用 TFS 为多个版本正确分支
我想这个问题已经被问过多次了,但找不到快速完整的答案。
假设我从头开始,希望设置 TFS 项目来处理两个并行版本,这两个版本可能会以不同的方式发展,但我仍然希望能够在两个版本中推送错误修复,我们称它们为 REL。 A 和 REL。 B,两者之间都会有不共享的代码更改,但可能是 REL 的错误修复。 A 应被推入 REL。 B.
从头开始,我先创建 main 还是 dev,哪个是另一个的分支?
相对值。 A是Dev还是Main的分支?
相对值。 B是REL的一个分支。 Main 或 Dev 的一个或一个分支?
谢谢。
I guess this has been asked multiple times already but couldn't find a quick and complete answer.
Let's say I start from scratch and would like to set up TFS project to work with 2 parallel releases which could evolve differently but still I want to be able to push a bugfix in both, let's call them REL. A and REL. B, both will have code changes not shared among them but could be that a bugfix from REL. A should be pushed into REL. B.
starting from the beginning, do I create the main or the dev first and which one is a branch of the other?
REL. A is a branch of Dev or Main?
REL. B is a branch of REL. A or a branch of Main or Dev?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的。基于此,这是我的高级建议。
由于这些是不同的产品,因此您可以采用产品分支方法。通过这种方法,您将:
然后,我会建议从每个 Bugfix、产品 A 和产品 B 分支中分支出一个“Dev”分支(只是为了良好的 SCM 实践)。
您的大部分工作将在您的产品分支中完成。如果需要修复错误,理想的做法是在 BugFix 分支中对其进行编码和测试。一旦经过认证可以使用“根”代码,您可以将该修复合并到 MAIN,然后将其转发到产品 A 和产品 B。
在不太理想的情况下,如果错误已在产品 A 中修复并且需要如果要反映在产品 B 中,您可以选择将代码从产品 A 合并到 MAIN,然后从 MAIN 合并到产品 B 和 BugFix。请记住,这是一种危险的方法,因为您可能会无意中将产品 A 的功能合并到产品 B。
Ok. Based on that, here's my high-level recommendation.
Since these are different products, you can go with a branch-on-product approach. In this approach, you would have:
I would then recommend a "Dev" branch branched off of each of the Bugfix, Product A, and Product B branches (just for good SCM practices)
The majority of your work would be done in your product branches. If a bug needed to be fixed, the ideal thing to do would be to code and test it in your BugFix branch. Once it has been certified to work with the "root" code, you would merge that fix to MAIN, then forward merge it to Product A and Product B.
In a less ideal situation, if the bug was fixed in Product A and needed to be reflected in Product B, you could cherry-pick merge just that code from Product A to MAIN, then from MAIN to Product B and BugFix. Keep in mind that this is a dangerous approach, in that you may inadvertently merge features from Product A to Product B.
Microsoft 有 Visual Studio Team Foundation Server 分支和合并指南,可用于选择分支结构。
Microsoft has Visual Studio Team Foundation Server Branching and Merging Guide , that can be used to choose the branching structure.