Transfer git repositories from GitLab to GitHub – can we, how to and pitfalls (if any)?

You can transfer those (simply by adding a remote to a GitHub repo and pushing them)

  • create an empty repo on GitHub
  • git remote add github https://[email protected]/yourLogin/yourRepoName.git
  • git push --mirror github

The history will be the same.

But you will lose the access control (teams defined in GitLab with specific access rights on your repo)

If you face any issue with the https URL of the GitHub repo:

The requested URL returned an error: 403

All you need to do is to enter your GitHub password, but the OP suggests:

Then you might need to push it the ssh way. You can read more on how to do it here.

See “Pushing to Git returning Error Code 403 fatal: HTTP request failed“.


Note that mike also adds in the comments:

GitLab can also be set to push mirror to downstream repositories, and there are specific instructions for push mirroring to GitHub.
This can use a GitHub Personal Access Token and also be set to periodically push.
You might use this option to share on GitHub, but keep your main development activity in your GitLab instance.


tswaehn suggests in the comments the tool piceaTech/node-gitlab-2-github

It is possible to migrate issues, labels, … with this tool github.com/piceaTech/node-gitlab-2-github: I tested it, not bad.
But had issues when transferring attachments of the issues itself.
Still worth a try maybe.

Leave a Comment