Converting a Mercurial (hg) repository to Git on Windows (7)
There is a lot of conflicting information about how to convert Mercurial repositories to Git on Windows. It really is pretty easy and only requires TortoiseHg and Git to be installed.
Preparation
Enable hg-git by adding the following to your Mercurial config file (%Userprofile%\mercurial.ini):
[extensions]hggit = hgext.bookmarks =[git]intree = True
Conversion
Navigate to the repository directory (that contains the .hg subdirectory) on the command line and execute the following commands:
hg bookmark -r default masterhg gexport --debuggit config --bool core.bare falsegit reset HEAD -- .
More information
You can find a detailed description of these steps in my blog article on the subject.