How to migrate a Mercurial code repository to Git

Posted on by

A very easy way to convert a Mercurial repository to Git is by using the fast-exportscript:

cd ~
git clone git://
git init git_repo
cd git_repo
git config core.ignoreCase false
~/fast-export/ -r /path/to/old/mercurial_repo
git checkout HEAD

If you have some special requirements you might want to have a look at the comments in this StackOverflow answer:


Leave a comment

Your email address will not be published.
Required fields are marked *