Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial branching and bookmarks

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?

like image 864
viraptor Avatar asked Nov 23 '09 02:11

viraptor


People also ask

What is a Mercurial bookmark?

Overview. Bookmarks are references to commits that can be automatically updated when new commits are made. If you run hg bookmark feature, the feature bookmark refers to the current changeset. As you work and commit changes the bookmark will move forward with every commit you do.

How do I close my HG branch?

the only way to do this is to delete it, or to hope they see the final merge commit and understand that the branch is closed to further development.

How do I create a branch in Mercurial?

Creating a branch Branching can happen by committing a changeset within a single repository or by committing diverging changes in distinct (but related) repositories. Two repositories are said to be related if they were once cloned from the same repository but later may have diverged.


1 Answers

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/

like image 177
Ry4an Brase Avatar answered Oct 17 '22 17:10

Ry4an Brase