Tuesday, 6 September 2011

Converting hg to git on Windows

Converting from hg/mercurial to git is really straightforward.
To start with, all I had was this instructional post. Sounds really easy and would not merit a post of it's own, if it wasn't for a bug in MSysGit.
Here's what I did to work around:
  1. Download the latest version of Ubuntu.
  2. Burn it on a CD.
  3. Reboot from the CD, using "Live CD" mode.
  4. Install git via the "Synaptic Package Manager"
  5. Still in the "Synaptic Package Manager", activate the "universe"-repository and install mercurial.
  6. Mount my hard drive so I have access to the hg's working copy.
  7. Follow the instructions from the post - but do everything in the user home.
  8. Finally, copy the resulting repository onto my harddrive
  9. Reboot into Windows.
The converted result looks like this.
Edit: Rob Rutherford suggests using Virtual Box and your personal flavor of Linux for a more persistent solution.
Edit: Or just boot Virtual Box with the ISO image I linked to above.