Hi, Github! Bye, Bitbucket!

Migrating Bitbucket Repos To Github

With many reasons, I decided to consolidate all my repos from Bitbucket to Github. Of course, this comes with costs which I will talk about later.


What I anticipate is a copy of all my repos in Github, and I will then no longer be using Bitbucket as origin.

To achieve it, I have to:

  1. clone all my repos from Bitbucket
  2. create repos of same names in Github
  3. update the origin of existing repos to the Github URLs.

These seem tedious if you do them manually. Luckily, someone has prepared a script for this purpose.

Using bitbucket-to-github

I forked bitbucket-to-github and added some extra bit to make it more relevant to my situation. In my version, I made these changes:

  • operations of same kind are run concurrently
  • repositories are cloned using SSH instead of HTTPS


The script is not a sophisticated piece, it is meant to “Get the job done!”. So, while the script is executing, monitor the console output all the time. Any error will not likely to halt the entire script but the message will be printed to the console.

Error message printed to console while running the script

In my case, one of my repos are not able to push to Github as I have blobs larger than 100mb. I didn’t spend time to work around it as the files are just some pickled trained NN model from my uni class long time ago.

read original article here