2

What's the best way to convert a Mercurial repo which uses bookmarks to a Git repo?

I've tried the steps listed here in Cygwin, but it converted only the default branch to master. The "branch" where I am using a bookmark on was not included in the conversion, although it did issue an error at the start about the Hg repo having an "unnamed" head.

The steps listed here (using git-hg) did not work at all.

Cygwin has Hg 1.9.3 and Git 1.7.5.1 installed, if that helps.

Community
  • 1
  • 1
Isxek
  • 1,096
  • 11
  • 19

1 Answers1

2

Mercurials hg-git plugin does the conversion you want. You need to place a bookmark on every revision you want to export to git, and then hg push /place/to/repo.git to export the commits.

Rudi
  • 19,366
  • 3
  • 55
  • 77
  • The hg-git docs say it can be used for this, but I'm getting [this error](http://paste.pocoo.org/show/520194/) during the conversion, which sounds like a problem with dulwich, according to [this thread](https://groups.google.com/forum/#!topic/hg-git/QiWRNlSJDfM/discussion). Other than this, it would have probably worked, so I'll accept this. – Isxek Dec 13 '11 at 11:41