Converting from git loses branch names

Greg Ward gerg.ward+hg at gmail.com
Wed Dec 3 09:28:49 CST 2008


On 02 December 2008, David Soria Parra said:
> No. Git actually has a different notion of a "branch". They are pointers
> to commits in the history, but the actual branch information is not stored
> in the changesets. In mercurial branch names are assigned to a changeset and
> therefore an immutable part of a changeset. If convert would convert the git
> branches it would result in immutable branches, which might not be desired.
> Therefore, as mercurial doesn't have same way of doing branching as git,  
> it is
> not 'converted'. So it's expected behaviour

Hmmm.  That is unfortunate.  Clearly I don't sufficiently understand
either git or Mercurial; I guess I'll have to spend some time thinking
about this before I can comment intelligently.  

So for now, please excuse me if I just whine and moan: waahhh!! I made
*one* *little* *mistake* in trying out git before trying out
Mercurial.  Now I've decided I like Mercurial more, but because I
cannot convert my git repos to Mercurial without losing information,
I'm stuck with git for those two projects.  Blech.

Can anyone think of a nice way to convert a git repository, keeping
all branch names?  I might try to do it manually, i.e. repeat each git
operation (commit or branch) as a Mercurial operation.  The tricky bit
is getting that information out of git.
       Greg


More information about the Mercurial mailing list