Few years back, Bitbucket shines when putting it next to Github. Before Github came up with Github Actions and free unlimited private repos, Bitbucket already did. Since I was freelancing, most of my repos need to be private, and paying is less of an option to me, I decided to use Bitbucket.
However, things have changed a lot. Github is now more comprehensive, and some necessary features are still missing in Bitbucket, like labeling a Git issue.
With Bitbucket, I also get a missing portfolio of mine which is the contribution activity graph. I believe most agree this is essential to developers for many purposes, despite this doesn’t reflect the true work one has done.
contribution activity of one of Arch Linux developers
With Github, I get security notifications if any of my repos has a vulnerable package.
Security warning from Github
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
To achieve it, I have to:
- clone all my repos from Bitbucket
- create repos of same names in Github
- update the
originof existing repos to the Github URLs.
These seem tedious if you do them manually. Luckily, someone has prepared a script for this purpose.
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.
Lastly, thanks pouriaa for creating the script that I could fork. Feel free to fork mine or his for your own usage!
First published on 2019-03-30
Republished on Hackernoon