Wiki

Clone wiki

BitBucket Hg to Git / FAQ

Home

Frequently Asked Questions

Why did you write bbhg2git?

Atlassian have stated that they will delete Mercurial projects on 1-June-20. All Hg users need to make a decision whether to:

  1. Move elsewhere and continue to use Mercurial
  2. Stick with BitBucket.org and convert to Git

    2.1. One might then choose to use Git natively, or

    2.2. Continue to use Mercurial on your client with some Git bridge/plugin mechanism to the server.

For me, option (2.1) made the most sense, hence I wrote this script. If you want to use Mercurial with Git plugins (2.2) that's something you're free to evaluate and choose if you wish.

What will happen to my existing repositories?

bbhg2git is completely non-destructive. Your existing repositories will be unaffected. Your code will be cloned locally using git --mirror and pushed back to a new repository on BitBucket with a similar name and slug but suffix '-git' appended. Most of the BitBucket repository settings, such as the description text, code language, public/private etc. are preserved on the new repository.
You can clone the new repo (using git!), investigate the state of the migrated code and safely delete that again if you're not happy.

Are named branches supported?

bbhg2git uses a Git extension, felipec/git-remote-hg to clone to a completely new repository, using Git. The README.md on that site lists several settings that you can use to affect its behaviour. It seems to convert Mercurial branches into Git ones (which is what I'd expect) but I'm not hugely experienced in Mercurial so would appreciate additional feedback here.

I want to convert using a different tool

The local repository conversion is done with a sequence of system commands in method migrateHg2Git around line 160. If you have found any bug(s) due to my conversion strategy or prefer a different tool, simply change the code there to suit. See https://bitbucket.org/edrandall/bitbucket-hg-to-git/pull-requests/4 for the start of an implementation using an alternative conversion tool.

Updated