Summary
- If you want to convert a Mercurial repository to a Git repository, without losing history, on a Windows machine, use Stelian Pop's script, but you'll need to run it under Cygwin.
- Prefer using msysGit for interactions with Github, since all the instructions for configuring it and dealing with newlines are clearly explained for you.
The Story
I've got a Ruby script for generating graphs of build duration and other metrics from CruiseControl, and it was in a Mercurial repository on my Windows machine. I'd chosen Mercurial for a couple of reasons:- I wanted to try out one of these newly popular distributed version control systems to see what the fuss is all about.
- I was writing the code on my laptop, then copying it to a machine on my client's network so I could run it against our CruiseControl build. I wanted to be able to make modifications on the other machine, perhaps in parallel to modifications on my laptop, and port them back. With Mercurial, the process was simple (zip up my repository from my laptop, email it to myself at my gmail account, download onto client machine, unzip, modify code, commit, rezip, re-email, unzip on laptop in a different location, 'hg pull' from new location to original location).
However all the hype these days seems to be about Git. I also wanted to get my code up on the web so others could have a go, and Github seemed to be the most natural place to put it. I wanted to keep the history of the project, so I started looking for a way to convert a Mercurial repository to Git. I found Ben Hood's blog post. However my msysGit bash shell installation (where I had been doing most of my Git work), did not have Python available. So I installed the git package into my local Cygwin installation, and the script worked there. I then went back to msysGit's bash shell for the upload to my Github repository, since I'd configured it with my SSH key etc as suggested by the Github guide for Windows.

0 comments:
Post a Comment