How to migrate GitLab/Bitbucket to GitHub in a simple way

Subscribe to the latest blog posts and projects.

GitHub has just announced a happy news today for us, developers.
Teams on GitHub can create unlimited private repositories for free.”

So, here are their newest updates on the free package.

These changes are so competitive to other code hosting services like Bitbucket or GitLab. Many teams are going to relocate their projects to GitHub as I think.

If you share the same idea and look for a simple way to migrate a repo from Bitbucket or GitLab, the followings are several simple steps to accomplish this.

  1. Inside your GitHub team page, create an empty private repo with the same name of Bitbucket/GitLab repo that you want to transfer.
  2. Copy your newly created repo link, either in HTTPS or SSH. For example, git@github.com:team-name/repo-name.git (SSH type)
  3. Inside your local project folder, change the remote URL under.git/config ‘s file to your copied GitHub's one. The content looks similar as follows. [remote "origin"]
    url = git@github.com:team-name/repo-name.git
    fetch = +refs/heads/*:refs/remotes/origin/*
  4. Do a git push: git push --all . It will push all codes and commit history on your newly GitHub repository.
  5. Done. After that, when we push new commits, it will push to GitHub only.
  6. The Bitbucket/GitLab repo now can be archived to ‘Read-only’ mode.

If you are interested in my new blog posts and projects, you can subscribe to my newsletter by clicking the below link.

Subscribe to the latest blog posts and projects.

Or please get in touch with me via Github, Twitter, Facebook, or LinkedIn. Happy coding and have a good time!

Software engineer and designer, currently building digital scent technology at aromajoin.com. Latest side project tinido.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store