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

Quang Nguyen
AndroidPub
Published in
2 min readApr 15, 2020

--

Checkout my latest app: Tinido.

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.

Screenshot was taken on April 15th, 2020. Source (https://github.com/pricing)

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.

Please get in touch with me via Github. Happy coding and have a good time!

--

--