Converting a Mercurial (hg) repository to Git on Windows (7) Converting a Mercurial (hg) repository to Git on Windows (7) python python

Converting a Mercurial (hg) repository to Git on Windows (7)


  1. Install Cygwin (with python, hg, git)
  2. Install git-hg
  3. run git-hg clone ...url...

Or tell me what the url is for this hg repo of yours, and I can convert it for you.


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.


Have you considered installing msysgit? The git bash shell it gives you should be able to run .sh files.