带有子模块的镜像Eclipse平台聚合存储库



我试图将eclipse Platform聚合器模块(https://git.eclipse.org/r/platform/eclitform/eclipse.platform.releng.aggregator.git.git(转到GitLab Repository。

目的是让竞争源(包括子模型(托管在本地存储库中,并在不访问外部网络访问源代码的情况下构建Eclipse平台。

这是遵循的步骤

尝试1

git clone --mirror https://git.eclipse.org/r/platform/eclipse.platform.releng.aggregator.git #with and without --recurse-submodules
git remote set-url --push origin ${local_repo_url}
git push --mirror # with and without --recurse-submodules=check

在第一次尝试时,内容被推到了本地存储库。但是,从本地存储库克隆存储库时,返回以下错误

 a) Cloned Metadata       -> Successful
 b) Registered SubModules -> Succesful
 c) Clone Sub Modules     -> Failed
Cloning into 'path/eclipse-platform/eclipse.jdt'...
remote: The project you were looking for could not be found.
fatal: repository 'local_repo_url/jdt/eclipse.jdt.git/' not found
fatal: clone of local_repo/jdt/eclipse.jdt' into submodule 
path 'path/eclipse-platform/eclipse.jdt' failed
Failed to clone 'eclipse.jdt'. Retry scheduled 

尝试2

git clone https://git.eclipse.org/r/platform/eclipse.platform.releng.aggregator.gi t --recurse-submodules #without mirror
git checkout master
git pull --recurse-submodules
git submodule update
git remote set-url --push origin ${local_repo_url}
git push --mirror --recurse-submodules=check

但是从本地存储库克隆出来,失败的错误(与尝试1中(相同。任何帮助将此仓库与子模型一起镜像,gitab repo,将不胜感激

谢谢,问候bipin。

默认情况下,当您克隆子模块时,使用.gitmodules文件中使用的URL。由于该文件仍然与您正在镜像的存储库相同,因此Git将尝试从原始远程获取该数据。

您需要在本地网络上单独镜像每个存储库。存储在存储库中的数据不包含其子模型中的任何数据,而仅包含.gitmodules目录中的引用。

关于解决克隆问题,最简单的方法是使用URL重写。因此,如果您想将https://mirror.example.org/foo/用作根而不是https://git.eclipse.org/r/platform/,则将运行以下命令:

git config --global "url.https://mirror.example.org/foo/.insteadOf" https://git.eclipse.org/r/platform/

请注意,您无法将此配置设置为存储库本地,因为当您克隆子模块时,大多会忽略父存储库的设置。

最新更新