根据我在开源项目中使用 git 和 mercurial 等分布式版本控制系统 (DVCS) 的经验,大多数设置模型对其项目使用集中设置(想想 GitHub)。
在将分布式 VCS 引入公司时,您是否有集中设置模型?
拥有某种中央存储库是个好主意,因为它允许您共享代码,但也有一个分支,您可以直接从中生成构建/导出快照。该服务器可能有多个分支,其中一个被认为是“主干”分支。任何以前的版本都会有自己的分支,并且取决于您的团队的层次结构(即,如果您被分成多个组,每个组都致力于应用程序的一个方面),那么可能会有基于团队或功能的分支,但如果您不这样做不要那样工作,这是不必要的。
当然,因为它是分布式的,所以每个开发人员也将拥有自己的本地存储库,以使事情变得又好又快。或者他们每个人都可以有多个存储库,甚至。例如,喜欢在通勤时工作的开发人员可能在他的工作站上有一个存储库,而在他的笔记本电脑上有另一个存储库,他的笔记本电脑上的分支是从他的工作站上的分支中“签出”的。这取决于他。我想“分布式”部分让这种事情变得容易多了,因为你可以在远离网络时提交甚至分支。
如果您从非分布式 VCS 过渡,那么您可以直接滑入与以前相同的模型,因为 DVCS 足够灵活,可以以相同的方式工作。否则,您可以从具有几个分支的单个中央存储库开始,以后创建更多存储库和分支总是很容易的。
最后一件事是您仍然需要备份。各个开发人员都拥有相同事物的副本这一事实增加了冗余,但它并不能代替备份。
我经常使用的 DVCS 是 Bazaar。我也尝试过 Mercurial。
是的,但你有很多选择。我见过的解释其中一些的最佳图表位于http://whygitisbetterthanx.com/#any-workflow。
Yes, I think for a company, or at least one product in the company, it is best or at least easiest to have a centralized setup model. You are trying to make a single coherent product, after all.
However, DVCS instills a different working spirit and mode which you may or may not want to encourage in your team. In particular, it increases experimentation (just use a local copy, and you're not bothering anyone). It is easier for maintenance of old versions, or if you do a lot of client-specific changes that need to be kept track of without putting them in the actual product.
It is invaluable when you have a team that works offsite a lot. In my company engineers often make last minute changes on site, where for security reasons they don't have internet access. Central VCS simply do not work for this scenario.
So there is a central repository, but the fact that you can work in a decentralized manner is invaluable. DVCS is a superset of centralized VCS in terms of workflows. Of course, you can still choose to use a centralized VCS if you don't think you'll need (or want!) the additional options.
这并不是将它们与称为中央化 VCS 的其他类型的 VCS 区分开来的功能。
因此,如果公司有 svn 方面的经验。使用存储库和备份模型的专用服务器,您可以为 DVCS 应用几乎相同的东西。