Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将repo从github迁移到gitlab?_Git_Github_Gitlab - Fatal编程技术网

如何将repo从github迁移到gitlab?

如何将repo从github迁移到gitlab?,git,github,gitlab,Git,Github,Gitlab,在我的例子中,UI导入不起作用,因为github位于我们的组织私有网络中,gitlab通过云vm托管,所以需要通过下面尝试的命令来实现。命令能够推送代码、所有分支和提交,但在gitlab中没有显示PR。在gitlab中获得PR还需要执行其他命令吗 我用来迁移的命令 git clone --bare clone_url_of_github cd .\sample-web-application.git\ git push --mirror url_of_gitlab git lfs fet

在我的例子中,UI导入不起作用,因为github位于我们的组织私有网络中,gitlab通过云vm托管,所以需要通过下面尝试的命令来实现。命令能够推送代码、所有分支和提交,但在gitlab中没有显示PR。在gitlab中获得PR还需要执行其他命令吗

我用来迁移的命令

 git clone --bare clone_url_of_github
 cd .\sample-web-application.git\
 git push --mirror url_of_gitlab
 git lfs fetch origin --all
 git lfs push --all url_of_gitlab


PR和PR上的注释通过API共享到GitLab,因此您运行的命令基本上可以帮助您从
GitHub
克隆存储库,并在
GitLab
上创建一个包含所有分支的镜像repo,因此在这种方法中,您无法在GitLab中获得
MR/PR
。因为您基本上拥有两个不同的存储库,其中一个只是另一个的镜像

我的建议是使用导入功能,其工作方式是捕获所有数据,如
githubapi
所述,并与
GitLab
共享,而不会丢失很多细节,因此这就是
GitLab
基本上能够捕获和存储这些
PR/MR
信息的方式当导入
PR
时,作为对
PR
以及官方
GitLab
迁移文档中列出的其他内容的评论

或者,由于您没有对
GitHub
repo的权限,我建议您转到
GitLab
实例,转到项目repo,查找各个分支,并使用GUI手动创建
MR/PR
。使用这种方法,您当然会丢失该特定分支的PR上所有来自
GitHub
的重要评论