Auto-sync Bitbucket to Github

    ?github=<USER>/<REPO>     [&branches=hgbranch:gitbranch[,...]]


BitSyncHub is a service to automatically mirror Bitbucket Mercurial repositories on GitHub. It is used by adding a POST service to your repository at Bitbucket, and adding as a contributor to your GitHub project. I wrote it to be able to mirror hgapi on GitHub, mainly to make it possible to use Travis CI.


  • Is it free?
  • For public projects on Bitbucket, yes.
  • It seems slow?
  • The service will only handle one repository at a time, to keep server load down. I might increase this in the future.
  • How does it work?
  • BitSyncHub clones your repository, creates bookmarks for branch mappings, and then uses hggit to push changes to GitHub. For git repositories, it just clones and pushes the master branch right now.
  • Couldn't you use bithubsync's access for evil?
  • Yes. I won't, though.
  • What technology do you use?
  • A custom WSGI app behind a Lighttpd server, Gunicorn, Python 3.3, Celery, MongoDB (for Celery), Mercurial, Git, and hggit.
  • Why isn't BitSyncHub open source?
  • It is, now.
  • Will you implement [feature]?
  • I don't know, ask me.


  1. In your Bitbucket repository, go to Administration (looks like a cogwheel), select 'Services'
  2. Select POST in the dropdown, and click 'Add service'
  3. In the URL field for your new service, enter (no spaces, replace and with values that make sense)
  4. (Unless you already have a mirror) Initialize an empty Github repo at
  5. Add bitsynchub as a contributor to your new Github repo
  6. Done; this will synch default->master
  7. To add more branches, add &branches=default:master,mybranch:mybranch to the service URL
  8. git to git synching is always done on master (branches are ignored)