W̶h̶y̶ ̶a̶n̶d̶ how
Disclaimer: This post is not related in any way to Microsoft’s recent acquisition of GitHub (I don’t really have a very strong opinion about it; although I hope that won’t affect us at all).
Next month, my GitHub annual subscription will end and I don’t want to renew it in order to reduce the high number of online services I currently pay for.
tl;dr: I’ll continue to use GitHub but not for private repositories.
There are many alternatives out there, but I’ve decided to migrate my private repositories to Bitbucket¹ (mainly because I’m used to using it at work²). The biggest obstacle is that they don’t provide any tool to import all the repos at once (we have to do the chore one by one…) so I’ve created a script³ to fill that gap. You’re welcome, Bitbucket :wink:
Moving checklist
- Python 2.7
-
FromGithubToBitbucket.py script (don’t forget to make it executable using
chmod +x
) - GitHub personal acces token (scopes needed: repo)
- Bitbucket app password ➡️ Bitbucket settings ➡️ App passwords (permissions needed: Repositories write)
- Bitbucket OAuth consumer ➡️ Bitbucket settings ➡️ OAuth ➡️ OAuth consumers (permissions needed: Repositories write&admin)
As you can see, we won’t expose any of our account passwords, so we can delete those temporary credentials afterwards.
Moving day
- Fill in the credentials
- Setup what kind of repo do we want to import
- **Run the script **and follow the instructions
- Dance!
This article was originally published on Medium
[1] Even though some people think it’s the ugliest one :wink:
[2] Also, I tried Gitlab long time ago and IMO their website was running slow and sluggish. Perhaps they have solved this by now, IDK :shrug:
[3] It has been tested under Linux/MacOS. What about Windows users? Well, can you tell me why you’re still using Windows? :trollface:
Top comments (5)
Why do you need a script to move?
Isn't it just easier to add bitbucket's repository as a remote and push there?
You can also use Bitbucket's import functionality: bitbucket.org/repo/import
:-)
I had more than 65 repos on GitHub so doing that manually it was not an option :)
OMG that's a lot! ahhahaha :-D
GitLab's import is oh-so-sweet.
It takes wikis, comments, and everything, not just the git.
Totally agree.