D Programming Language source (dmd, phobos, etc.) has moved to

foobar foo at bar.com
Sat Jan 29 06:49:16 PST 2011


Russel Winder Wrote:

> On Sat, 2011-01-29 at 11:18 +0100, "Jérôme M. Berger" wrote:
> [ . . . ]
> > 	In Mercurial (and AFAIK Git), branches and repositories are
> > completely different concepts. A repository is a folder on your hard
> > drive. A branch is a history line inside a repository so it's not
> 
> Definitely, this is not at issue.  The way Git and Mercurial store
> information about branches and tags within a repository is very
> different.  This leads to a few observable differences in the way
> branches and commits behave, but in the main there is similarity not
> difference.  Caveat Git's index of course.
> 
> > that different from Bazaar. The only difference I see is that Bazaar
> > allows you to clone a single branch (i.e to create a repository that
> > will only contain that single branch) whereas a clone of a Mercurial
> > repository will always contain all the branches that the parent had
> > (don't know about Git).
> 
> This is not quite the right view of Bazaar.  In Bazaar, the branch is
> the only thing that exists: each branch is a standalone entity that may
> or may not have a working tree.  Bazaar also has shared repositories
> which can act as containers of branches, allowing related branches to
> share common information thereby saving resources.  This is a very, very
> different concept of repository compared to Mercurial or Git.  In Bazaar
> you do not branch repositories, you branch branches -- which may (or may
> not) be stored in repositories.  As you say with Git and Mercurial you
> clone repositories.
> 
> -- 
> Russel.
> =============================================================================
> Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at russel.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> 

The conceptual difference described above seems to me more of an insignificant minor implementation detail than anything else. 

A git repository can contain one or more branches and you obviously can have more than one repository so this boils down to your personal workflow preferences. 
In other words you can have multiple repositories for the same project and just use them as branches. Git also provides sub-module support such that one repository contains other repositories. 
Also, while "git clone" indeed copies all the upstream branches, it's also simple to track just a specific branch (or any subset) of the upstream branches. It's just a matter of doing a git init with the relevant options instead of relying on the default git clone behavior. 


More information about the Digitalmars-d-announce mailing list