Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.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
将git回购复制到另一个组织中_Git_Repository_Code Duplication - Fatal编程技术网

将git回购复制到另一个组织中

将git回购复制到另一个组织中,git,repository,code-duplication,Git,Repository,Code Duplication,Git新手问题。我设置了两个组织,希望将存储库从一个组织复制/复制到另一个组织。 具体步骤是什么?您只需通过克隆库即可 您可以通过以下方式实现这一点 考虑一下testRepo是某个组织或用户下的回购名称sampleOrg 因此,您的git url将是https://github.rackspace.com/sampleOrg/testRepo 第一步。在需要复制的其他组织下创建同名回购 eg: `https://github.rackspace.com/sampleOrgMirror/te

Git新手问题。我设置了两个组织,希望将存储库从一个组织复制/复制到另一个组织。
具体步骤是什么?

您只需通过克隆库即可

您可以通过以下方式实现这一点


考虑一下
testRepo
是某个组织或用户下的回购名称
sampleOrg

因此,您的git url将是
https://github.rackspace.com/sampleOrg/testRepo

第一步。在需要复制的其他组织下创建同名回购

   eg: `https://github.rackspace.com/sampleOrgMirror/testRepo`
第二步。运行:
git克隆--barehttps://github.com/sampleOrg/testRepo.git

步骤3:运行:
cdtestrepo.git

步骤4:运行:
gitpush--mirrorhttps://github.com/sampleOrgMirror/testRepo.git

步骤5:运行:
cd..

步骤6:运行:
rm-rf old repository.git

现在您的代码在
https://github.com/sampleOrgMirror/testRepo.git

您可以通过链接了解更多详细信息

这是一次性复制操作,还是两个存储库应该持续更新?我真的认为第一步是稍微更新一点。
git copy https://github.com/org1/repo.git https://github.com/org2/repo.git
   eg: `https://github.rackspace.com/sampleOrgMirror/testRepo`