TFS/源代码管理:如何管理修补程序 [英] TFS /Source Control: How to manage hotfixes

查看:31
本文介绍了TFS/源代码管理:如何管理修补程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了解使用 TFS/source-control 管理修补程序的正确方法.

I try to understand the right approach for managing hotfixes with TFS /source-control.

假设我有一个只包含两个文件(app.js 和 util.js)的小项目.这两个文件都受源代码控制(Team Foundation Server).

Say I have a small project to contains only two file (app.js and util.js). Both files are under source control (Team Foundation Server).

假设我在两周前应用了一个标签,该标签指示部署到服务器的里程碑 1".从那以后,我应用了其他一些修改(扩展了 app.js 并添加了其他文件).

Assuming I applied two weeks ago a label that indicates the "milestone-1" that was deployed to the server. Since then I applied several other modifications (extended app.js and added another files).

今天我发现了一个错误,所以我从服务器获取带有里程碑-1"标签的版本,修改 util.js 并将此版本部署到服务器.目标是在服务器上只部署包括 hotfix-1 的版本里程碑 1",而不是我过去两周应用的修改.

Today I found a bug so I get the version with the label "milestone-1" from the server, modify the util.js and deploy this version to the server. The goal is that on the server only the version "milestone-1" including the hotfix-1 is deployed but not the modification I applied the last two weeks.

问题是:我如何/在哪里将修补程序签入到 TFS?因为明天我可能会发现另一个错误,所以我必须获得版本里程碑 1"和用于应用第二个修补程序的修补程序 1 基础.

The question is: How /where do I check-in the hotfix to the TFS? Because I might find another bug tomorrow so I have to get the version "milestone-1" and the hotfix-1 base base for appling the second hotfix.

有没有办法将我的代码版本签入到位于"标签里程碑 1"和我的最新版本之间的 TFS 中?

Is there a way to check-in a version of my code into the TFS that "sits" between label "milestone-1" and my latest version?

推荐答案

使用分支和合并!

我们有以下开发周期:

  1. 创建初始项目,分配权限,并导入到 TFS 分支名称Main"下.
  2. 因为这是开发的初始迭代,我们从 main 分支Dev",这就是开发人员工作的地方.请注意,目前还没有正式版本.
  3. 开发完成后,它会合并回 Main.主分支上没有任何开发工作.
  4. 我们从 main 分支Release",这是实际部署代码和更新版本号的点.

好的,接下来,我们必须做出一些修改.再一次,Main"再次分支出来,开发工作继续向下开发分支.一切都很好.然后用户报告了一个需要修复的错误,并且需要快速修复.但是我们的其他开发已经进行了一半!!怎么办?

Ok, so, further down the line, we have to make some amendments. Once again, "Main" is branched out again and the development work continues down the Dev Branch. All is well. Then a user reports a bug that needs fixing, and it needs fixing fast. But we're half-way through our other development!! What to do?

此时,我们再次从 main 分支.我们将其称为HotFix".该错误已修复,然后 HotFix 合并回主程序.然后我们可以将它合并到我们的发布分支,并发送更新.我们当前的开发工作没有中断,到目前为止我们所做的工作都没有在 Main 上存在).

At this point, we branch from main again. We'll call it "HotFix". The bug is fixed, and then HotFix is merged back in to main. We can then merge it in to our release branch, and the update is sent out. Our current dev work is not interrupted, and none of the work we have been doing up to this point exists on Main).

我们终于完成了我们的开发工作,我们将其合并回主分支,然后再进行发布.由于我们的 Hotfix 分支合并到了 main 中,我们的新开发工作包含了我们之前即时完成的修补程序.

We finally finish our dev work, and we merge that back in to the main branch, and then in to release. Because our Hotfix branch got merged in to main, our new development work also contains the hotfix we did on the fly earlier.

这篇关于TFS/源代码管理:如何管理修补程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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