Bitbucket-hg-to-git is a project mainly written in PYTHON and C, it's free.
This is a nasty little python script that was hacked together to copy and convert your bitbucket mercurial repositories to git.
This is a nasty little python script that was hacked together to copy and convert your bitbucket mercurial repositories to git. It is very crude with little error checking (I only needed to run it once).
Backup your repos first. This app is not destructive, it does not delete mercurial repos, it renames them. That said you should have a local backup of your repos anyway.
Steps
python convert.py
All other dependencies are are packaged with this script they include:
zzz{repo name} HG
. I put the zzz prefix so it would move to the bottom of your dashboard (and so I could id repos that have already been converted).If you deploy from bitbucket (like I do) you will need to update your local code to point either the new git repo or the new url for the hg repo.
Not everything will be converted to your new git repo. You will loose issues, wiki pages followers etc.
It would be cool to do some command line arguments to only covert a subset of repos etc. I wanted to convert all my repos so I didn't take the time to do this.
It would also be cool to include a backup script to backup clone all your bitbucket repos locally. I have one that I use; perhaps I will clean it up and release it.