DVCS中不同分支模型的优缺点 [英] Pros and cons of different branching models in DVCS

查看:130
本文介绍了DVCS中不同分支模型的优缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

分布式版本控制(Git,Bazaar和Mercurial)的三大处理器分支处理方式都不相同。例如,在集市中,分支机构是单独的回购协议(实际上是父代回购协议的不同副本);在您的文件系统上,不同的分支位于不同的目录中。另一方面,在Git中,您可以在同一个仓库中存在多个分支(因此可以在您的文件系统的同一目录中)。 Mercurial支持这两种行为 ,后者的命名分支

这些不同分支模型有哪些优点和缺点?在我看来,Bazaar的一个分支,一个回购的方法比Git的方法更让分支更痛苦(例如,在集市中使用分支,我必须先创建分支,然后从我当前的工作副本中cd出来,然后退房新分支,就像我在SVN中那样)。

解决方案

Bazaar不要求你按照你描述的方式工作。其实我写了一篇博文它在两天前。你可以只用一个工作树来工作,在不同的分支之间切换并创建新的分支而不用离开工作树。有用的命令是: 结帐 切换 分支 - 切换 。查看Bazaar的工作流文档,您将看到你可以用任何你想要的方式配置它。


The Big Three of distributed version control (Git, Bazaar, and Mercurial) each treat branching fairly differently. In Bazaar, for example, branches are separate repos (actually, divergent copies of the parent repo); on your file system, different branches live in different directories. In Git, on the other hand, you can have multiple branches existing in the same repo (and therefore in the same directory on your file system). Mercurial supports both behaviors, the latter with named branches.

What are the pros and cons associated with these different branching models? In my mind, Bazaar's approach of one branch, one repo makes branching more of a pain than Git's approach (e.g. to use a branch in Bazaar, I have to first create the branch, then cd out of my current working copy, then check out the new branch, like I would in SVN).

解决方案

Bazaar doesn't require you to work the way you describe. I've actually written a blog post about it two days ago. You can work pretty much with only a single working tree, switching between various branches and creating new branches without leaving the working tree. Useful commands for this are: checkout, switch, branch --switch. Check out the workflow documentation for Bazaar, you will see that you can configure it in almost any way you want.

这篇关于DVCS中不同分支模型的优缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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