Convert Bitbucket Mercurial repositories to Git

git clone git@github.com:frej/fast-export.git
  • Clone the Mercurial repository you want to convert:
hg clone ssh://hg@bitbucket.org/your_username/your_hg_repository
  • Create a new Git repository on Bitbucket and clone it:
git clone git@bitbucket.org:your_username/repository.git
  • 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/hg-fast-export.sh -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 Handoff.design and Sendcloud