Hi, Github! Bye, Bitbucket!

Melvin Koh
Mar 30 · 3 min read

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 warnings 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 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.

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.


Last, thanks pouriaa for creating the script that I could fork. Feel free to fork mine or his for your own usage!

HackerNoon.com

how hackers start their afternoons.

Melvin Koh

Written by

Full Stack Developer, AWS Solutions Architect, Pythonista, JavaScripter. Find me on Twitter @melvinkcx2 😁

HackerNoon.com

how hackers start their afternoons.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade