Convert Bitbucket Mercurial repositories to Git

git clone
  • Clone the Mercurial repository you want to convert:
hg clone ssh://
  • Create a new Git repository on Bitbucket and clone it:
git clone
  • cd into the cloned Git repository and run:
git config core.ignoreCase false
  • Then, convert the Mercurial repository by running (this assumes fast-export and your Mercurial repository is cloned into your $HOME directory):
~/fast-export/ -r ~/your_hg_repository/
  • Checkout HEAD and push to the remote:
git checkout HEAD && git push



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bjorn Heesakkers

Bjorn Heesakkers

Full Stack Developer. Working for and Sendcloud