[Cialug] Version Control

Jeffrey C. Ollie jeff at ocjtech.us
Fri Jun 8 10:54:26 CDT 2007


On Fri, 2007-06-08 at 10:27 -0500, Chris Freeman wrote:
> Does anyone know why GIT is 'better' for merging than CVS/Subversion?
> Does it have to do with the performance of merging two branches
> multiple times over time?

Performance is part of it, but not the whole story.

Say you start out with a repository that looks like this:

 ---A---B---C---D

You create a branch starting at D and do some work:

                  X---Y---Z
                 / 
 ---A---B---C---D

In the meantime other developers do some work on the main branch:

                  X---Y---Z
                 /
 ---A---B---C---D---E---F---G---H

Now you want to merge your branch back into the main branch.  You want
things to end up looking like this:

                  X---Y---Z--------
                 /                 \
 ---A---B---C---D---E---F---G---H---M

However, CVS and Subversion have no clue about the fact that the
branches diverged at point "D" (well, at least SVN knows about branch
points, but it doesn't make any use of that information).

Git keeps track of all that history and can make use of it when merging
branches.  It becomes even more tricky as the history of the project
becomes more complicated.

Mercurial and the other distributed SCMs keep a similar history and use
it in a similar manner.

It's my opinion though that Git does it better than any of the others.
Performance is part of the reason, but the Git developers have done a
lot to make merges "just work".

Jeff

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://cialug.org/pipermail/cialug/attachments/20070608/13ef2649/attachment.pgp


More information about the Cialug mailing list