源代码控制的最佳实践是什么?

时间:2020-12-24 20:03:26

After a recent "accident" at work, whereby some bugs that previously had been fixed were reintroduced, I was asked to document a set of guidelines for the use of source code control (CVS in this case).

在最近发生的“事故”工作之后,重新引入了之前修复过的一些错误,我被要求记录一套使用源代码控制的指南(本例中为CVS)。

What do you consider to be best practices for using source code control? In particular, how do you manage branching and labelling and how do you ensure that the current production release can be patched while continuing to develop new features? For context, the team size is up to 10 developers in two locations.

您认为使用源代码控制的最佳做法是什么?特别是,您如何管理分支和标签,以及如何确保在继续开发新功能的同时修补当前的生产版本?对于上下文,团队规模在两个位置最多有10个开发人员。

8 个解决方案

#1


8 Commandments of Source Control pretty much sums it up.

8源代码控制的命令几乎总结了它。

On the topic of branching and labeling what we do at work is:

关于分支和标签的主题我们在工作中做的是:

Labeling

When ever an environmental release is done it is labeled with at the very least the date of the release. All (related) bugs are then set so that the "resolved in release" is this label.

当环境释放完成时,它至少标记为释放日期。然后设置所有(相关的)错误,以便“解决释放”是此标签。

Branching

Only created on an as-needed basis. A branch is done off a label so that a change can be done against a previously released version (ie, fixing a bug on production without including all other bug fixes)

仅根据需要创建。分支是在标签上完成的,这样就可以对以前发布的版本进行更改(即修复生产中的错误而不包括所有其他错误修复)

#2


Eric Sink already put one together in his Source Control Howto.

Eric Sink已经在他的Source Control Howto中加入了一个。

#3


I'm not sure that I would put "CVS" and "best practice" in the same sentence. There are many other, better, more modern choices for source control that are well-supported by the community.

我不确定我会在同一句话中加入“CVS”和“最佳实践”。还有许多其他更好,更现代的源代码控制选择,得到社区的充分支持。

#4


The mainline model. The tofu scale.

主线模型。豆腐规模。

Read this: http://oreilly.com/catalog/practicalperforce/chapter/ch07.pdf

请阅读:http://oreilly.com/catalog/practicalperforce/chapter/ch07.pdf

#5


update as often as possible(depeding on the project growing speed) this way fixed files wont be able to be reintroduced. Intruct the developers to perforn an update before comiting.

尽可能经常更新(取决于项目的增长速度),这样修复文件就无法重新引入。在开始评论之前,让开发人员进行更新。

#6


There are different kinds of workflows, you will have to consider which best meets your team needs.

有不同类型的工作流程,您必须考虑哪种最适合您的团队需求。

Also I always recommend the SVN Book.

我也总是推荐SVN书。

#7


The book "Pragmatic Version Control (using Subversion)" is a really nice place to start. Even though its examples are specific to Subversion, it's a good intro to all the important concepts and practices.

“Pragmatic Version Control(使用Subversion)”这本书是一个非常好的起点。尽管它的示例是针对Subversion的,但它是所有重要概念和实践的一个很好的介绍。

#8


We try very, very hard not to branch. If we do create a branch it's a team decision and is carefully scrutinized. So I guess the practice would be "don't branch lightly".

我们非常非常努力地不分支。如果我们确实创建了一个分支,那么这是一个团队决策,并经过仔细审查。所以我想这种做法是“不要轻易分支”。

#1


8 Commandments of Source Control pretty much sums it up.

8源代码控制的命令几乎总结了它。

On the topic of branching and labeling what we do at work is:

关于分支和标签的主题我们在工作中做的是:

Labeling

When ever an environmental release is done it is labeled with at the very least the date of the release. All (related) bugs are then set so that the "resolved in release" is this label.

当环境释放完成时,它至少标记为释放日期。然后设置所有(相关的)错误,以便“解决释放”是此标签。

Branching

Only created on an as-needed basis. A branch is done off a label so that a change can be done against a previously released version (ie, fixing a bug on production without including all other bug fixes)

仅根据需要创建。分支是在标签上完成的,这样就可以对以前发布的版本进行更改(即修复生产中的错误而不包括所有其他错误修复)

#2


Eric Sink already put one together in his Source Control Howto.

Eric Sink已经在他的Source Control Howto中加入了一个。

#3


I'm not sure that I would put "CVS" and "best practice" in the same sentence. There are many other, better, more modern choices for source control that are well-supported by the community.

我不确定我会在同一句话中加入“CVS”和“最佳实践”。还有许多其他更好,更现代的源代码控制选择,得到社区的充分支持。

#4


The mainline model. The tofu scale.

主线模型。豆腐规模。

Read this: http://oreilly.com/catalog/practicalperforce/chapter/ch07.pdf

请阅读:http://oreilly.com/catalog/practicalperforce/chapter/ch07.pdf

#5


update as often as possible(depeding on the project growing speed) this way fixed files wont be able to be reintroduced. Intruct the developers to perforn an update before comiting.

尽可能经常更新(取决于项目的增长速度),这样修复文件就无法重新引入。在开始评论之前,让开发人员进行更新。

#6


There are different kinds of workflows, you will have to consider which best meets your team needs.

有不同类型的工作流程,您必须考虑哪种最适合您的团队需求。

Also I always recommend the SVN Book.

我也总是推荐SVN书。

#7


The book "Pragmatic Version Control (using Subversion)" is a really nice place to start. Even though its examples are specific to Subversion, it's a good intro to all the important concepts and practices.

“Pragmatic Version Control(使用Subversion)”这本书是一个非常好的起点。尽管它的示例是针对Subversion的,但它是所有重要概念和实践的一个很好的介绍。

#8


We try very, very hard not to branch. If we do create a branch it's a team decision and is carefully scrutinized. So I guess the practice would be "don't branch lightly".

我们非常非常努力地不分支。如果我们确实创建了一个分支,那么这是一个团队决策,并经过仔细审查。所以我想这种做法是“不要轻易分支”。