Moving from GitHub to Bitbucket – Why and How

I was recently tasked with the assignment of moving all of the Top Draw GitHub repos over to Bitbucket. When I was assigned this task, my first thought was, “What the heck is Bitbucket?” I had heard the name before but had never dug any deeper into it. For those of you who, like me, don’t know what Bitbucket is, here’s its description according to its website: “Bitbucket is the Git solution for professional teams.”

My second thought after being assigned this task was, “Why are we doing this? I love GitHub!” If you’re a developer, you can probably relate to me when I say that GitHub is my source for everything from jQuery plugins to grid frameworks to PHP libraries, so why would we abandon it?

What is Bitbucket, exactly?

bitbucketBitbucket, similar to GitHub, is a web based GIT hosting service for your projects. It offers free private repositories with free private wikis on accounts of up to 5 users. Preferably used for companies and not open source, Bitbucket is one of the largest GIT hosting services on the web.

Why did we move away from GitHub?

As a first time user, I didn’t notice that much difference from GitHub (other than the user interface). I was able to browse my code, see my commits, clone, push and pull my repos just as I did on GitHub. So why move from our beloved GitHub over to Bitbucket? While we could give you an extensive list of why we chose to host with Bitbucket, here are a few of our key reasons:

1. Unlimited Private Repos

As our company grows and we work with more and more clients, the number of private repositories in our GitHub account also grows.

GitHub’s  free account doesn’t allow for private repos and their lowest paid option (for organizations) only allows up to 10 private repos. We outgrew that number very quickly. We found ourselves constantly having to upgrade our account to accommodate our growth. Bitbucket, on the other hand, offers unlimited private repos. This was a huge factor as we would no longer have to worry about running out of private repository space!

repos

2. Pricing

Not only was it cumbersome to have to upgrade our accounts due to growth, it was also getting expensive.

GitHub’s pricing model is based on the number of private repos you require. Starting from 10 private repos for $25.00/month all the way up to 1500 repos for $2050.00/month.

githubprices

Unlike GitHub, Bitbucket does things a little different. Bitbucket offers all of its pricing plans with unlimited private repos. Instead of basing their pricing from repos, they do it by users allowed on the account.

bitbucketpricing

And because we have a smaller development team, we are able to cut our costs.

3. Ease of Change

worriedWhenever we change from what we know, we get nervous. A lot of questions get raised: Is it difficult to use? Will we need to learn new commands? Is it going to take us weeks or months to transfer everything over?

The answer to all of those questions is, no. Bitbucket is extremely user-friendly, uses the exact same commands, and took only a few hours to transfer all of our repos over.

How did we transfer to Bitbucket?

Bitbucket makes it extremely easy to transfer your repos from GitHub. Here are the steps on how to do so:

1. Backup your GitHub repo

githubzip

The first thing we did was backup our repos in case something bad happened in the transfer. To do so, you can simply go to your repo and click the Download ZIP button.

2. Copy your HTTPS clone URL

githubhttps

We chose to transfer via the HTTP clone URL. The clone URL can be found right next to the Download ZIP button that you just clicked (there is even a nice copy-to-clipboard button).

3. Import your repo into Bitbucket

bitbucketcreate

Next, you will want to log into your Bitbucket account and create a repository. Then, instead of filling out the required information, you can import a repository by clicking the link in the top right corner (or https://bitbucket.org/repo/import if you are logged in).

4. Fill out the information required

import

Fill out the required information from Bitbucket and click the “Import Repository” button.

importing

Note: If your authorization credentials are wrong, you may get an error. Simply click back, fill out the information correctly and import again.

And that’s all folks!

Just like that, we have now imported our GitHub repo into our BitBucket account.

A note about wikis and issues

One problem was that issues and wikis didn’t transfer over as part of my initial import. However, we found some resources that made the task fairly easy, provided you have some command line knowledge. Check these out:

http://codetheory.in/export-your-issues-and-wikis-from-github-repo-and-import-to-bitbucket-migration/
https://github.com/sorich87/github-to-bitbucket-issues-migration
https://confluence.atlassian.com/bitbucket/export-or-import-issue-data-330797432.html

Love enough for two…

While I love GitHub, and still crown it the King of open-source sharing, I have to tip my hat to Bitbucket for their price and for making the process of transferring repositories as easy as possible. I was skeptical about the change over at first, but after working with Bitbucket, I would strongly suggest anyone working with large numbers of private repos consider Bitbucket an option.

  • I picked Bitbucket for my static websites, then I just link them to Netlify which uploads them instantly to their server. :)

    The reason why I chose Bitbucket was because of the free private repos. With a static site you have to upload all content into your repo, which can be bad for SEO in terms of duplicate content, plus I want my website designs to be unique and not copied by others. :)

    • Tim Pettersen

      If you’re using Bitbucket to host the content for your static sites, you may be interested in Aerobatic’s Bitbucket integration: https://www.aerobatic.com/
      For the small-ish sites I’ve been working on deploys take ~12 seconds from the time I push to Bitbucket.

      • Yeh, I know about that. Unfortunately it’s a bit expensive for me to be paying $10 per month when I only have one static site at the moment. Maybe if I decide to create more websites.

        • Tim Pettersen

          Not to spruik ’em too hard, but you get two free sites. I think you only have to enter your payment details once you want a third.

          • Yes, but I don’t think you can have your own domain on those two free sites, can you?

          • jasongowans

            Hi Alex, co-founder of Aerobatic here – you can have a free, auto-renewing wildcard SSL cert and all of our other features as part of the free tier. Cheers! https://www.aerobatic.com/features/

  • Neeks L

    Was there any consideration into hosting a private Gitlab?

  • magnusanderssen

    Backing up with zip… Amateurs !

    You like taking “risks”.

    Seriously, why not just clone the repos?

    • asdfasdf

      Cause it takse 1 minutes longer. Duh!

  • Seems the price is very legit reason to move your private repos to bitbucket, just one thing that for me bitbucket UI is not fresh .. hehehe