将 git 存储库从 GitLab 传输到 GitHub - 我们可以,如何操作和陷阱(如果有)? [英] Transfer git repositories from GitLab to GitHub - can we, how to and pitfalls (if any)?
问题描述
如果需要,可以将存储库从 GitLab 转移到 GitHub.如果是这样,我该怎么做呢?
Can one transfer repositories from GitLab to GitHub if the need be. If so, how exactly can I go about doing the same?
此外,考虑到我可能决定最终将它们移至 GitHub(因为它目前具有更多我可能觉得方便的功能),我在这样做之前是否需要牢记在此之前的任何陷阱或预防措施用于我的项目).
Also, are there any pitfalls in doing so or precautionary measures that I need to keep in mind before doing so given that I may decide to eventually move them to GitHub (as it has more features at the moment that I might find handy for my project).
推荐答案
您可以传输这些(只需将远程添加到 GitHub 存储库并推送它们)
You can transfer those (simply by adding a remote to a GitHub repo and by pushing them)
- 在 GitHub 上创建一个空仓库
git远程添加github https://yourLogin@github.com/yourLogin/yourRepoName.git
git push --mirror github
历史将是相同的.
但是您将失去访问控制(在 GitLab 中定义的团队对您的存储库具有特定访问权限)
But you will loose the access control (teams defined in GitLab with specific access rights on your repo)
如果您在 GitHub 存储库的 https URL 方面遇到任何问题:
If you facing any issue with the https URL of the GitHub repo:
The requested URL returned an error: 403
您需要做的就是输入您的 GitHub 密码,但 OP 建议:
All you need to do is to enter your GitHub password, but the OP suggests:
然后您可能需要以 ssh 方式推送它.您可以在此处阅读有关如何操作的更多信息.
Then you might need to push it the ssh way. You can read more on how to do it here.
请参阅推送到 Git 返回错误代码 403 致命:HTTP 请求失败".
这篇关于将 git 存储库从 GitLab 传输到 GitHub - 我们可以,如何操作和陷阱(如果有)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!