Converting Hg repositories to Git

By on October 5, 2011

Bitbucket launched Git support on Monday and now that things have settled in, there has been great response from the community and plenty of questions.

One of the questions that has gained the most attention is, “How can I convert my existing Mercurial (Hg) repos to Git?”

We have an answer! Shahar Evron has done an awesome job of writing up a tutorial on converting from Hg to Git. The steps involve:

  1. renaming your Hg repositories
  2. install the HgGit plugin
  3. push the code into your Git repository
  4. switch your local repo to Git

Check out the full tutorial detailing how to convert your hg repositories to git and be done in no time!

6 Comments

  • Posted October 7, 2011 at 9:56 am | Permalink

    HgGit is slow and introduces its own commits, which is unacceptable for many users. I suggest, just as PSyton in comment to linked tutorial, using hg-fast-export, which is a much better solution.

  • Posted October 7, 2011 at 9:56 am | Permalink

    HgGit is slow and introduces its own commits, which is unacceptable for many users. I suggest, just as PSyton in comment to linked tutorial, using hg-fast-export, which is a much better solution.

  • Posted October 7, 2011 at 9:56 am | Permalink

    HgGit is slow and introduces its own commits, which is unacceptable for many users. I suggest, just as PSyton in comment to linked tutorial, using hg-fast-export, which is a much better solution.

  • Lorenzo Petrone
    Posted April 30, 2012 at 3:02 pm | Permalink

    Maybe I’m missing something, but how does this preserves the project users, issues, wiki, and so on?
    This looks more like a generic “convert an hg repo to git”, but coming from a repository host I’d expect at least to _consider_ this problem…

  • Steve
    Posted June 25, 2012 at 5:58 pm | Permalink

    +1 for hg-fast-export

  • Carlos Romero
    Posted May 16, 2013 at 7:05 pm | Permalink