views:

126

answers:

3

I have read nice things about "branch" in Git recently. It seems like Mercurial's way may be to clone a local repo? But Mercurial has branch too. Does it work as nice as Git?

What about saving disk space in Mac / Linux / Windows? Do they all do links on Mac and Linux but make a copy on Windows?

+5  A: 

Mercurial automatically creates branches whenever you commit diverging changesets, whereas Git works with an explicit branch creation model. Depending on your preferences, your development style, and your project needs, either one can be "better".

Amber
+2  A: 

As far as i know - it's quite close but not as good as in git.

Jimmy wrote nice articles about using workflow he was used to work with git when working with Mercurial.

Arnis L.
+1  A: 

My understanding of Mercurial is that it allows for divergence in a single branch as well as creation of explicit branches. Say Amy and Bob are working on a project. They both pull changeset 1 and work on it, then they both commit their changes and push the changes back to bitbucket. The next time they pull, there will be two incompatible heads (changesets 2 and 3), so the default branch will need to be resolved if they want to keep the changes.

On the other hand, if Amy sets up a new branch (hg branch bestbranch), then there will still be two heads, but both Amy and Bob can work on independent changesets, resolving them at some future date.

philosodad