Last Updated: February 25, 2016
·
5.594K
· Marko Klemetti

Converting Repositories From Git to Mercurial

Mercurial probably has the best default tool available for converting from other repository types.

Conversion

To convert Git repository to Mercurial first enable the hg convert-tool by adding the plugin definition to your .hgrc-file (located in your home directory)

[extensions]
hgext.convert=

Then convert your repository by running:

hg convert --datesort <source> <destination>

Mercurial Converter supports CVS, Subversion, Git, Darcs, Monotone, Bazaar, GNU Arch, Mercurial and Perforce

Installing Mercurial on OSX

It is easiest to install Mercurial using Homebrew:

brew install mercurial

But you can optionally use Python's pip:

brew install pip && pip install mercurial