Convert Hg to Git

I have several Bitbucket-hosted Mercurial repos for my binary baseline and some development projects. I started to use Mercurial because the syntax was easier. In the meantime I have been using Git at work and could not remember the Mercurial commands. Time to convert. How?

Thanks to this article, “Converting Mercurial to Git”, it is easy. Kind of. Had to install ActiveState Python, then install the Mercurial package

>pypm install mercurial

Then here are the basic instructions:

$ cd ~/Desktop
$ git clone git://
$ git init git_repo
$ cd git_repo
$ ~/Desktop/fast-export/ -r /path/to/old/mercurial_repo
$ git checkout HEAD

Since I use the wonderful msysgit git-bash shell, the script worked, except the `dirname $0` failed for some reason. I just replaced the dynamically generated value with the actual location of the repo.

So mine was

 ~/Desktop/git_repo (master)
$ ~/Desktop/fast-export/ -r /c/bin
ROOT=/c/Documents and Settings/Loaner/Desktop/fast-export
master: Exporting full revision 1/130 with 1/0/0 added/changed/removed files
master: Exporting simple delta revision 2/130 with 7118/0/0 added/changed/removed files
Exported 1000/7118 files
Exported 2000/7118 files
master: Exporting simple delta revision 127/130 with 0/1/0 added/changed/removed files
master: Exporting simple delta revision 128/130 with 1/0/0 added/changed/removed files
master: Exporting simple delta revision 129/130 with 3/9/0 added/changed/removed files
master: Exporting thorough delta revision 130/130 with 6/25/1 added/changed/removed files
Issued 130 commands

Everything was on master, so this was an easy test. So far so good. Of course, the EOL issues exist – so on the validation comparison, I set WinMerge to ignore line endings. We’ll see how that works out.

BTW make sure you update the source repo before you convert. I’m just sayin’.

OSX – show environment vars of a running process

jenkins$ ps -wwE -p 38654
38654 ?? 67:40.42 /usr/bin/java -Xmx2048m -XX:MaxPermSize=512m -jar /Application
/Jenkins/jenkins.war SHELL=/bin/bash TMPDIR=/var/folders/5f/qnywwqmx3h5fxnwlcssp2sr00000gn/T/ USER=jenkins __CF
_USER_TEXT_ENCODING=0x1F5:0:0 JENKINS_HOME=/Users/Shared/Jenkins/Home PATH=/usr/bin:/bin:/usr/sbin:/sbin PWD=/