Github is a great service and remains the epicentre of open source code. But for a single developer paying for private repositories, its payment plans don’t make a lot of sense. This is because they charge by the number of repositories you have. I tend to have quite a few small private repos for various projects, so the cost creeps up pretty quick. I have absolutely no objection paying Github for private repos, but the pricing structure does need to be sensible.

Bitbucket’s pricing structure makes a lot more sense. They charge by the number of users, rather than repositories. As a bonus, it is free for up to 5 users. And you get unlimited repositories, a price increase is only triggered by an increase in the number of users. This makes a lot more sense than charging my repositories because it better reflects the size of the organisation. A large organisation with more users will pay more, a smaller organisation with less users will pay less and a single developer will pay nothing without being constrained by the number of repositories. Makes sense right?

Like I said before, I don’t mind paying. The fact that bitbucket give it to me for free is a bonus.

Moving repos from Github to Bitbucket

Now down to the meat of this post - how to actually move your private repositories from Github to Bitbucket!

Import from Github to Bitbucket

  1. In Bitbucket on the top menu, click Repositories and then Import Repository Fields for importing existing code from Github
  2. Select Git
  3. Select ‘Require Authentication’. Add the username and password from your github account. Note: You will get an authentication denied error anyway, which you can ignore.
  4. Copy the URL from your Github account. This should be This can be found in the right hand column under HTTPS URL of repository on Github
  5. Add the URL you copied in step 4 to URL field in Bitbucket
  6. The fields under New repository will be automatically filled in, including the Name. If you want to change the name and add a description, you can do so here. Fields for the new repository in Bitbucket
  7. Click import repository.

Change the origin URL

  1. Go to the repository on your local machine on the command line
  2. Type: git remote -v. This should show that the repo origin is still on github. E.g. origin (fetch) origin (push)
  3. Edit the git config file for the repository: sudo nano .git/config
  4. Change url (under remote “origin”) and change to You may need to change the username if your username is different on bitbucket. You should also change it to the git URL. i.e.

Delete Github repository

Once you are happy that everything is working correctly with Bitbucket, it is time to delete the repository from Github.

  1. Go to the repo
  2. Go to settings Link to Github repository settings
  3. Under the Danger zone tab, click delete this repo

Downgrade your plan

Now that you have your repository safely on Bitbucket, and you have it deleted from Github, it is time to save some money and downgrade your Github plan to the free one.

  1. Go to settings for your account. Go to billing tab. Click on change plan tab. Downgrade to free account.


Repeat for all of your private repos.

That is all there is to it! If you have never used Bitbucket before, it is a good idea to do this for one repository first and ensure you are happy with Bitbucket before you switch everything over.