Github is awesome. Bitbucket is awesome too. They are both excellent services, but Bitbucket has a plus: it's free for private repos.
That's one of the reasons on why we decided to stop paying our $25/mo Github account for small projects and moved to Bitbucket. Although the Bitbucket guys have now a one-click "import from Github tool", the solution is so simple that I don't even think it is worth using it. Because at the end of the day, even if you uset it you'll need to change by hand where your origin points to anyway.
The following example is a Github to Bitbucket migration keeping the same files (no other clone needed). You can use this code for any service though, it works with any git repo:
First of all create your new blank repository and then go to your shell and do:
git pull git push --mirror firstname.lastname@example.org:your_user/your_repo.git git remote set-url origin email@example.com:your_user/your_repo.git # or the same using HTTPS: # git remote set-url origin https://bitbucket.org/your_user/your_repo.git
These three lines do the following:
- Get the last changes from your current origin
- Copy the entire repository (with all the commit data) to the new origin
- Change the old origin to the new location
After this you can git pull/push/whatever as if nothing happened. You don't need to clone anything again. You have Github migrated to Bitbucket!