在 TFS 中的项目之间合并和分支共享代码 [英] Merging and branching shared code between projects in TFS

查看:33
本文介绍了在 TFS 中的项目之间合并和分支共享代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前负责将我们的 asp.net 应用程序从源安全迁移到 TFS.我们有三四个非常相似的应用程序(比如电子商务),它们目前共享一个核心库(服务、业务逻辑、实体、数据访问等).

I'm currently in charge of migrating our asp.net applications from source safe to TFS. We have three or four very similar apps (let us say e-commerce) that currently share a core library (services, business logic, entities, data access etc).

应用程序相似但不完全相同,因此一个应用程序可能会获得其他应用程序无法获得的功能集等.

The applications are similar but not identical so one app might get a feature set the others won't get etc.

我想停止代码共享,而是设置分支(如果合适),因此如果我更改应用程序 A:s 核心库中的某些内容,我将需要将更改与其他分支合并,而不是让它们获取更改自动地.这是为了避免在您从主干更新时出现意外,突然另一个项目的核心发生了变化,并且该项目以某种方式中断.

I want to stop the sharing of code and instead set up branches (if that fits) so if I change something in Application A:s core library I will need to merge the changes with the other branches instead of them getting the changes automatically. This to avoid surprises when you update from your trunk and suddenly the core has changed for another project and this project breaks in some way.

关于我应该如何在 TFS 中设置它的任何建议?我是否应该拥有一个不直接用于作为所有其他核心的父项的任何项目中的主"核心,以便我可以将更改从一个核心推送到该核心,然后将其分发到其他核心?这是否有意义?在 TFS 中设置是否容易?

Any suggestions on how I should set this up in TFS? Should I have a "main" Core that is not directly used in any project that is the parent of all the other cores so I can push changes up to that one from one core and then distribute it to the other cores? Does that make sense and would it be easy to set up in TFS?

推荐答案

针对您的评论,我建议您阅读 CodePlex 网站.

In response to your comment, I'd suggest you to read up on Feature branches on the CodePlex website.

场景 4 – 功能分支
在这种情况下,您创建一个开发分支,执行工作那个分支,然后合并你的工作回到你的主要源代码树.你组织您的开发分支基于产品特性.这以下是显示的物理视图功能开发分支:

Scenario 4 – Branch for Feature
In this scenario, you create a development branch, perform work in that branch, and then merge your work back into your main source tree. You organize your development branches based on product features. The following is a physical view showing branching for feature development:

我的团队项目

      Development -> Isolated development branch container  
        Feature A -> Feature branch  
           Source  
        Feature B -> Feature branch  
          Source  
        Feature C -> Feature branch  
          Source  
        Main      -> Main Integration branch
          Source

在不久的将来,我们也将从 SS 迁移到 TFS.

We are alos moving from SS to TFS in the near future.

据我所知,我们将保持我们的 SS 存储库在线并在 TFS 中重新开始.我们的框架可能会在TFS中获得自己的项目.项目特定的共享单元需要不时合并.

As I perceive it, we are going to keep our SS repository online and start fresh over in TFS. Our framework probably will get its own project in TFS. Project specific shared units will need to get merged from time to time.

您构建存储库的方式取决于您的具体情况.每个分支场景都有其特定的优点和缺点.

The way you structure your repository depends on your specific situation. Every branch scenario has its specific advantages and drawbacks.

  • 有多少项目
  • 有多少开发人员
  • 开发人员是否专注
  • 您是否需要并发修补程序
  • 您需要服务包吗

查看 CodePlex 分支指南,了解做出明智决定所需的所有信息关于你的 TFS 结构.打印备忘单并将它们固定到您的墙以供快速参考.

Take a look at the CodePlex branching guide for all the information you need to make an informed decision about your TFS structure. Print out the cheat sheets and pin them to your wall for quick reference.

在执行分支计划之前,注意这个警告消息 - 您创建的每个分支都可以有成本所以确保你得到一些从中产生的价值.的力学TFS 中的分支被简化为单击鼠标右键单击分支命令.但是,分支的总成本通过降低代码速度来支付主要,合并冲突和附加测试可能很昂贵.

Before executing on your branch plan, pay attention to this cautionary message - every branch you create does have a cost so make sure you get some value from it. The mechanics of branching in TFS are simplified to a single right click branch command. However, the total cost of branching is paid by reduced code velocity to main, merge conflicts and additional testing can be expensive.

这篇关于在 TFS 中的项目之间合并和分支共享代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆