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

后端 未结 6 1620
生来不讨喜
生来不讨喜 2020-12-02 03:32

Can one transfer repositories from GitLab to GitHub if the need be. If so, how exactly can I go about doing the same?

Also, are there any pitfalls in doing so or pre

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 04:17

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

    • create an empty repo on GitHub
    • git remote add github https://yourLogin@github.com/yourLogin/yourRepoName.git
    • git push --mirror github

    The history will be the same.

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

    If you facing 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".

提交回复
热议问题