paint-brush
Hi, Github! Bye, Bitbucket!by@melvinkcx2
1,636 reads
1,636 reads

Hi, Github! Bye, Bitbucket!

by Melvin KohMarch 30th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Using bitbucket-to-github script to migrate all my repos from Bitbucket to Github. The script is not a sophisticated piece, it is meant to “Get the job done!” It is just some pickled trained NN model from my uni class long time ago. It is not likely to halt the entire script but the message will be printed to the console while running the script. Feel free to fork mine or his for your own usage of the script that I could fork.

Company Mentioned

Mention Thumbnail
featured image - Hi, Github! Bye, Bitbucket!
Melvin Koh HackerNoon profile picture

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.

How?

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

melvinkcx/bitbucket-to-github

Caveat

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!