gpt4 book ai didi

git - check out 带有子模块的 git 存储库时出错

转载 作者:行者123 更新时间:2023-12-04 11:45:36 25 4
gpt4 key购买 nike

在 Jenkins 实例上部署我的测试时,我注意到一些子模块无法初始化。

在 Jenkins 中,我选中了 Use credentials from default remote of parent repository 的复选框。这使得初始化第一个子模块成为可能。不幸的是,无论我做什么,其余的都不起作用。

 > git remote # timeout=10
> git submodule init # timeout=10
> git submodule sync # timeout=10
> git config --get remote.origin.url # timeout=10
> git submodule init # timeout=10
> git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10
> git config --get submodule.sub1.url # timeout=10
> git remote # timeout=10
> git config --get remote.origin.url # timeout=10
> git config -f .gitmodules --get submodule.sub1.path # timeout=10
using GIT_SSH to set credentials
> git submodule update --init --recursive sub1
> git config --get submodule.sub2.url # timeout=10
> git remote # timeout=10
> git config --get remote.origin.url # timeout=10
> git config -f .gitmodules --get submodule.sub2.path # timeout=10
using GIT_SSH to set credentials
> git submodule update --init --recursive sub2
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
[Bitbucket] Notifying commit build result
[Bitbucket] Build result notified
hudson.plugins.git.GitException: Command "git submodule update --init --recursive sub2" returned status code 1:
stdout:
stderr: Cloning into '/var/jenkins_home/workspace/develop/sub2'...
repository does not exist.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@bitbucket.org:xxxx/xxx.git/sub2' into submodule path '/var/jenkins_home/workspace/develop/sub2' failed
Failed to clone 'sub2'. Retry scheduled
Cloning into '/var/jenkins_home/workspace/develop/sub2'...
repository does not exist.
fatal: Could not read from remote repository.

我还在 .git/config 中检查了这一点,我有到 bitbucket 中其他存储库的正确路径。

最佳答案

我遇到了同样的问题。从其物理位置删除所有子模块,然后重试:

git submodule update --init

关于git - check out 带有子模块的 git 存储库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54387750/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com