你是在分支还是在主干中继续开发? [英] Do you continue development in a branch or in the trunk?

查看:31
本文介绍了你是在分支还是在主干中继续开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您正在开发一个定期发布的软件产品.关于分支和合并的最佳实践是什么?将定期发布的分支分割给公众(或您的客户是谁),然后在主干上继续开发,或者将主干视为稳定版本,定期将其标记为发布,并在分支中进行实验工作.人们认为行李箱是黄金"还是沙箱"?

Suppose you're developing a software product that has periodic releases. What are the best practices with regard to branching and merging? Slicing off periodic release branches to the public (or whomever your customer is) and then continuing development on the trunk, or considering the trunk the stable version, tagging it as a release periodically, and doing your experimental work in branches. What do folks think is the trunk considered "gold" or considered a "sand box"?

推荐答案

我已经在一个大型商业应用程序中尝试了这两种方法.

I have tried both methods with a large commercial application.

哪种方法更好的答案在很大程度上取决于您的具体情况,但我会写下迄今为止我的整体经验所显示的内容.

The answer to which method is better is highly dependent on your exact situation, but I will write what my overall experience has shown so far.

总体上更好的方法(根据我的经验):躯干应该始终保持稳定.

以下是此方法的一些准则和好处:

Here are some guidelines and benefits of this method:

  • 在自己的分支中对每个任务(或相关任务集)进行编码,然后您可以灵活地选择何时合并这些任务并执行发布.
  • 应该在每个分支合并到主干之前对其进行 QA.
  • 通过对每个单独的分支进行 QA,您将更容易准确地了解导致错误的原因.
  • 此解决方案适用于任意数量的开发者.
  • 此方法有效,因为在 SVN 中分支几乎是即时操作.
  • 标记您执行的每个版本.
  • 您可以开发暂时不打算发布的功能,并确定何时合并它们.
  • 对于您所做的所有工作,您都可以从提交代码中受益.如果你只在主干之外工作,你可能会保持你的代码未提交很多,因此不受保护并且没有自动历史记录.

如果您尝试相反的做法并在主干中进行所有开发,您将遇到以下问题:

If you try to do the opposite and do all your development in the trunk you'll have the following issues:

  • 每日构建的不断构建问题
  • 当开发人员为项目中的所有其他人提交问题时生产力损失
  • 更长的发布周期,因为您需要最终获得稳定版本
  • 不太稳定的版本

如果您试图保持分支稳定并将主干作为开发沙箱,那么您将无法获得所需的灵活性.原因是你不能从主干中挑选你想要放入那个稳定版本的东西.已经全部混在后备箱里了.

You simply will not have the flexibility that you need if you try to keep a branch stable and the trunk as the development sandbox. The reason is that you can't pick and chose from the trunk what you want to put in that stable release. It would already be all mixed in together in the trunk.

我特别想说在主干中进行所有开发的一种情况是,当您开始一个新项目时.根据您的情况,可能还有其他情况.

The one case in particular that I would say to do all development in the trunk, is when you are starting a new project. There may be other cases too depending on your situation.

顺便说一下,分布式版本控制系统提供了更大的灵活性,我强烈建议切换到 hg 或 git.

By the way distributed version control systems provide much more flexibility and I highly recommend switching to either hg or git.

这篇关于你是在分支还是在主干中继续开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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