Mercurial branching and bookmarks

MercurialBranchBookmarks

Mercurial Problem Overview


I read some information about named branches and working with bookmarks. Unfortunately I still don't see a difference between them. Is there any?

Is there any difference between:

hg branch blah
hg up blah

and

hg bookmark blah
hg up blah

?

Why would I use a bookmark and how is it different from a named branch?

Mercurial Solutions


Solution 1 - Mercurial

Bookmarks are tags that move forward automatically to subsequent changes, leaving no mark on the changesets that previously had that bookmark pointing toward them. Named branches, on the other hand, are indelible marks that are part of a changeset. Multiple heads can be on the same branch, but only one head at a time can be pointed to by the same bookmark. Named branches are pushed/pulled from repo to repo, and bookmarks don't travel.

There's a great branching comparison here: http://stevelosh.com/blog/entry/2009/8/30/a-guide-to-branching-in-mercurial/

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionviraptorView Question on Stackoverflow
Solution 1 - MercurialRy4an BraseView Answer on Stackoverflow