Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Mercurial, what's the difference between a 'head' and a 'branch'?

Tags:

dvcs

mercurial

I'm new to Mercurial, and DVCS in general. What's the difference between a head and a branch?

like image 824
Daniel Serodio Avatar asked May 31 '11 13:05

Daniel Serodio


People also ask

What is a branch in Mercurial?

The term 'branch' may thus refer to a 'diverged line of development'. For Mercurial, a 'line of development' is a linear sequence of consecutive changesets.” In other words, we spawn off a new line of development from a base (or “parent”) state of the code.

How can I change branch in Mercurial?

From the main menu, select Hg | Mercurial | Update to. In the Switch Working Directory dialog that opens, specify the target working directory: To switch to another line of development, choose Branch and select the desired branch from the list.

How do I delete a branch in Mercurial?

You cannot. You can close the branch to hide it from the list of active branches, but you cannot completely delete it. This happens because in mercurial and in git the "branch" term means different things. In mercurial - it is a set of changesets.

How do you create a new branch in Heartgold?

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

If you view it as a tree, then a head is a leaf, at the very end of a branch.

It's explained really well at Mercurial's own wiki:
Branches
Heads

like image 104
Aeveus Avatar answered Dec 09 '22 11:12

Aeveus