Git 设置从海外服务器到本地服务器的镜像repo
我们的项目涉及中国的5名开发人员和美国的3名开发人员。中国的服务器机器被视为主机器。我想建立一个从中国服务器到美国服务器的回购镜像,这样我们的本地开发者可以更快地Git 设置从海外服务器到本地服务器的镜像repo,git,repository,mirror,Git,Repository,Mirror,我们的项目涉及中国的5名开发人员和美国的3名开发人员。中国的服务器机器被视为主机器。我想建立一个从中国服务器到美国服务器的回购镜像,这样我们的本地开发者可以更快地repo sync。现在,从中国服务器发出的repo init/sync需要5个小时 例如,假设中国服务器名为server1.China.com,美国服务器名为server2.usa.com 使用以下命令从China server中提取项目: repo init -u ssh://server1.china.com/projectA/s
repo sync
。现在,从中国服务器发出的repo init/sync
需要5个小时
例如,假设中国服务器名为server1.China.com
,美国服务器名为server2.usa.com
使用以下命令从China server中提取项目:
repo init -u ssh://server1.china.com/projectA/standard.git -b release17
repo sync
我希望能够设置本地镜像,以便将项目拉入成为:
repo init -u ssh://server2.usa.com/projectA/standard.git -b release 17
repo sync
我还希望定期运行一个cron作业,以便在初始设置之后将最新的更改从server1拉到server2
我已经看过关于使用git clone--mirror的讨论,但不太确定它是否能满足我的需要
谢谢您想要的是
repo init--mirror
,来自repo init-h
:
--mirror create a replica of the remote repositories rather
than a client working directory
创建后,您可以使用
repo sync
使其保持最新状态。此问题可能更适合于其他stack exchange论坛之一,因为它与编程无关,看起来像的副本。完成此操作后,我必须修改.repo/manifests/default.xml
文件,如中所示