如何使用 TFS 为多个版本正确分支

发布于 2024-10-20 02:14:39 字数 309 浏览 2 评论 0原文

我想这个问题已经被问过多次了,但找不到快速完整的答案。

假设我从头开始,希望设置 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 技术交流群。

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

发布评论

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

评论(2

眉黛浅 2024-10-27 02:14:39

好的。基于此,这是我的高级建议。

由于这些是不同的产品,因此您可以采用产品分支方法。通过这种方法,您将:

MAIN - 基线代码。
错误修复 - 从主分支分支。 (这是任何共享错误修复都会发生的地方)
产品 A - 从主分支分支。
产品 B - 从主分支分支。

然后,我会建议从每个 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:

MAIN - The baseline code.
BugFix -Branched from main. (This is where any shared bug fixes would occur)
Product A - Branched from main.
Product B - Branched from main.

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.

享受孤独 2024-10-27 02:14:39

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.

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