Re: coming from git, understanding mercurial branching
- From
Tay Ray Chuan <rctay89@gmail.com>
- Date
- Sep 6, 2013, 04:39 UTC
- Message-ID
- <CALUzUxoa7Lw-_sj3LRj-9=hSh17hi+j4JhfAPKaDfhuE8PnKCA@mail.gmail.com>
- In-Reply-To
- <20130905212714.636db4c4@bigbox.christie.dr>
On Fri, Sep 6, 2013 at 10:27 AM, Tim Chase <git@tim.thechases.com> wrote:
Show 5 quoted lines
> I've got a pretty good grasp on git's rather straightforward > branching, but am trying to wrap my head around Mercurial's > branching. There seem to be several flavors, some default to > push-public, while others are private; some are tracked in history, > while others seem more ephemeral;
First: recognize Mercurial's branches are entirely different beasts from Git's. They just happen to be given a same sequence of characters, b-r-a-n-c-h. The similarities end there!
> often the docs suggest cloning > instead of branching; detached heads seem more normal in the > Mercurial world.
Are you referring to this?
$ hg clone https://... master $ cd master # hack...
$ cd .. $ hg clone https://... fix1 $ cd fix1 # hack...
$ cd../master $ hg pull ../fix1 $ hg merge ...
In git, you would have your master branch, checkout -b fix1, then merge them back to master when you're done. The above describes how one would do this in mercurial.
-- Cheers, Ray Chuan