Differences between revisions 3 and 10 (spanning 7 versions)
Revision 3 as of 2009-01-25 17:02:23
Size: 1684
Editor: RobertFendt
Comment: Initial version
Revision 10 as of 2013-08-26 23:14:44
Size: 472
Editor: Jaqueline
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Branching and merging in Mercurial (and Git) explained =
Since there seems to be a bit of confusion about just what branching methods are provided by Mercurial as opposed to e.g. Git (at least I was confused...), this page will hopefully explain the different branching mechanisms and alternatives in more detail.

== Short-term branching in Mercurial ==

Let's start with the branching model in Mercurial, since it is somewhat simpler. Consider three developers: Alice, Bob and Clark. Alice has started work on a new project, and Bob and Clark are to take part in the development. For the sake of simplicity, let's assume we are in a local network, and all three developers can pull changes from each other. Alice's repository looks currently like this:

She has created two revisions, A and B. In her repository, these have gotten revision numbers 1 and 2. The revision B is the newest in the repository (called the tip in Mercurial speak, marked green), and also the parent of her current working directory state (marked with an asterisk). Now Bob and Clark both clone her repository and start working. Meanwhile, Alice continues to work too, of course. So after a short while, Alice's repository has changed:

Bob's repository

and Clark's repository contain changes too:

It is important to note that Bob's and Clark's changes are independent of Alice's, which means that each of them has created his own branch. Now, they want to merge their work, and since Alice is project leader, she decides to do it in her repository. She pulls both the changes made by Bob and by Clark into her repository, which now looks quite different from before:
----
CategoryHowTo
Kristina is my name and then I totally dig it name.<<BR>>
<<BR>>
Administering databases is my time frame job now but today my husband and That we will start our unique business. What I really enjoy doing is solving puzzles yet I'll be starting a process else along with this method. Vermont is our birth point but my husband wants us to move. Go to my website to understand out more: http://blogs.birminghampost.net/business/2012/07/management-gurus-purveyors-of.html

Kristina is my name and then I totally dig it name.

Administering databases is my time frame job now but today my husband and That we will start our unique business. What I really enjoy doing is solving puzzles yet I'll be starting a process else along with this method. Vermont is our birth point but my husband wants us to move. Go to my website to understand out more: http://blogs.birminghampost.net/business/2012/07/management-gurus-purveyors-of.html

BranchingExplained (last edited 2013-08-27 17:11:38 by AugieFackler)