How to migrate private repository from BitBucket to GitHub

Last year Microsoft bought GitHub for $7.5B and shortly after that they have changed their policy on private repositories. Before, private repositories were reserved only for paying members, but since January 7th 2019 even non-paying users are allowed to have unlimited private repositories.

In case you want to migrate your private repository from BitBucket to GitHub and keep all the previous gits.

First, login to your GitHub and make a new empty private repository (do not tick “Initialize this repository with a README”). You can use any name but the best practice is to use the same name as on BitBucket.

Now let’s clone the repository from BitBucket and push it back to GitHub. Make sure to replace geektnt with your bitbucket/github username and coolproject with an actual repository name.

git clone --mirror https://bitbucket.org/geektnt/coolproject.git
cd coolproject.git
git remote set-url --push origin [email protected]:geektnt/coolproject.git
git push --mirror

After this is done you can leave the folder and remove the repository directory (since it’s not usable project as it’s cloned with –mirror parameter)

cd ..
rm -rf coolproject.git

And you can now clone it from GitHub and continue where you have stoped:

git clone [email protected]:geektnt/coolproject.git
cd coolproject
...
(make changes, add, commit, push...)

At this point you can remove old BitBucket repository if everything works at GitHub.

This way to migrate worked out amazing for me and I have moved couple of my older private projects from BitBucket to GitHub so I can have them all at one place.

Hello world!

Hello fellow geeks or geek wannabes ūüôā
This is post number one and according to geek tradition it simply must start with standard

Hello World!

Okay, now once we got that out of the way (and are now for sure that it’s working), I want to discuss what is this blog all about.¬†Well, I’m self thought PHP/MySQL developer and Linux System administrator. Except that I do fairly good with lots of other coding tools (like Java, Visaul Basic…), but I really like web developmental the most and this is why I’m going to write mostly about that. I have split the blog in few areas:

  • Just Sayin’ – in here I’ll post about various stuff that come up on my mind and that don’t fit in any other category
  • Server Administration – in here I’ll try to write tutorials, guides and tips that can be useful to any admin (beginner¬†or expert)
  • Web¬†Development¬†– I’ll write in here about various stuff including but not limited to: php, javascript, Ajax, jQuery, Prototype, Smarty, Code¬†Igniter…
  • WordPress¬†– is one of my¬†favorite¬†web¬†development¬†tools. It’s easy to use and customize and I love working with it, so I’ll devote a whole category just to it.

Make sure you bookmark the site so you can find it later more easily or subscribe to our feed to keep updated. I don’t need to mention that you need to press CTRL+D to add site to bookmarks, right? Your Geek too! Geeks know this kind of stuff!

Thanks for visiting my blog.

T.