将源代码管理的变更提交给多个分支的实际方式 [英] Practical way to commit changes in source control to multiple branches

查看:193
本文介绍了将源代码管理的变更提交给多个分支的实际方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用源代码控制时的常见情况是具有开发分支以及版本化版本分支。我们使用CVS,HEAD作为开发分支,以及一个名为例如release-6-2用于当前发行的产品。

A common scenario when using source control is to have a development branch along with versioned release branches. We use CVS, with HEAD as the development branch, and a branch named e.g. release-6-2 for the current release of a product.

开发新功能仅适用于开发分支,但是错误修复有时必须检查开发部门和当前发布部门。有时候这可能会相当乏味,所以我正在寻找实际的方法来实现这一点。

Development of new features go into the development branch only, but bug fixes sometimes have to be checked into both the development branch and the current release branch. This can get quite tedious at times, so I am looking for practical ways to accomplish this.

当要提交的文件在两个分支上同步时,我特别是寻找一个快速的承诺这些分支解决方案。

When a file to be commited is in synch on the two branches, I am in particular looking for a quick "commit to these branches" solution.

(我们使用CVS作为我们的源代码控制系统,所以任何CVS特定的答案都是不错的,还有一点很有趣的是看其他源代码管理系统是否能够提供更好的方法
在客户端我们使用Eclipse,所以Eclipse解决方案是好的,但是如果你有一个非Eclipse解决方案,那也是很好的。 )

(We use CVS as our source control system, so any CVS-specific answers are nice. However, it is also interesting to see whether other source control systems can offer a better way. On the client side we use Eclipse, so Eclipse solutions are good. But if you have a non-Eclipse solution, that is fine too.)

推荐答案

将您的修复程序应用于所需的最早的发行版本。然后将更改合并到下一个发行版分支,等等,直到您从最后一个发行版分支合并到HEAD。

Apply your fix to the oldest release branch required. Then merge the change to the next release branch and so on until you merge from the last release branch to the HEAD.

说您的产品的最旧版本是1.0,而你也有1.1和1.5版本。下一个版本的新功能正在添加到HEAD中。如果在1.0中发现了一个错误,则可以将该修复应用于1.0分支。从1.0合并到1.1分支。从1.1到1.5分支合并,最后从1.5分支合并到HEAD。

Say the oldest version of your product is 1.0 and you also have 1.1 and 1.5 releases. New features for the next release are being added to the HEAD. If a bug is found in 1.0, you apply the fix to the 1.0 branch. Merge from 1.0 to the 1.1 branch. Merge from 1.1 to the 1.5 branch, and finally merge from the 1.5 branch to the HEAD.

从分支到分支合并优于将手动手动应用于每个分支。

Merging from branch to branch is better than applying the fix manually to each branch.

使用CVS,您必须自行跟踪合并的版本,以便在下次合并时不要包含相同的修订版本。

With CVS you have to mannually keep track of what versions are merged, so that you do not include the same revisions when you do your next merge.

如果您更改为使用Subversion,则从分支到分支合并更容易。 Eclipse的subversion工具将跟踪您先前合并的修订版本,大大简化了两个分支之间重复合并的任务。

If you change to use Subversion, merging from branch to branch is easier. Eclipse's subversion tool will keep track of what revisions you have previously merged, greatly simplifying the task of doing repeated merges between two branches.

从CVS更改为Subversion很容易(ish)。你不会是第一个这样做的人。

Changing to Subversion from CVS is easy(ish). You won't be the first to have made such a move.

这篇关于将源代码管理的变更提交给多个分支的实际方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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