I have a number of branches in a git repository:
david@Panama ~/app: git branch -r
origin/HEAD -> origin/master
origin/master
origin/newButtons
origin/newFonts
origin/serverView
If I try and import this git repo into mercurial:
david@Panama ~/: hg convert app
...
david@Panama ~/app-hg: hg update
388 files updated, 0 files merged, 0 files removed, 0 files unresolved
david@Panama ~/app-hg: hg branches
default 1148:6d04af619607
It seems that the branches have been "lost" (in terms of them no longer being separated) and indeed merged into the tip:
david@Panama ~/app-hg: hg log
changeset: 1148:6d04af619607
tag: tip
user: convert-repo
date: Mon Nov 16 17:57:06 2009 +0000
summary: update tags
changeset: 1147:742e7a01a6c9
parent: 1144:bff259181b22
user: user1
date: Sat Nov 14 17:47:09 2009 +0000
summary: Playing around with fonts to get a cleaner look
changeset: 1146:162c1b0dd648
parent: 1144:bff259181b22
user: user1
date: Fri Nov 13 21:12:21 2009 +0000
summary: Playing with new server view
changeset: 1145:aa06857832ab
user: user1
date: Sat Nov 14 13:54:12 2009 +0000
summary: Updated buttons to something more fitting
changeset: 1144:bff259181b22
user: David Mytton <>
date: Fri Nov 13 10:35:51 2009 +0000
summary: Example
Given that being the case:
a) Am I doing something wrong to import the branches here?
b) Can the branches actually be imported?
This is by design. Imported Git branches are only labeled in Mercurial, and
hg headsshould give you the correct number of imported “branches”.As mentioned in this thread:
Consider a tree that looks like this:
So:
You can test it with a small Git repo (Git 1.6.5.1, Hg1.3.1):
Make a bunch of modifications in three separate branches:
Then clone that Git repo (just in case, to male other tests)
Configure your
~/.hgrcwith a formatUTF-8without BOM (took me a while to get it right!)Then make the conversion
You will get the three expected “branches”