如何在没有身份验证的情况下递归克隆公共GitHub存储库?

时间:2015-06-17 13:26:40

标签: git github

我正在尝试将应用程序从GitHub部署到测试服务器中。我在服务器中创建了一个新用户来拥有本地存储库并运行应用程序。稍后,该用户还应自动从存储库执行每日拉动。

我可以使用这个新用户从存储库运行一个简单的git clone。但是,当我尝试获取其所有子模块(git clone --recursive)时,我收到此错误:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of 'git@github.com:organisation/submodule.git' into submodule path 'submodule' failed

所有子模块也是GitHub上的公共存储库,我可以使用这个新用户单独克隆到服务器。为什么它们不能被克隆为子模块?

1 个答案:

答案 0 :(得分:1)

您的子模块配置为使用git:进行克隆 - 更新.gitmodules以引用https:网址。变化:

git@github.com:organisation/submodule.git

https://github.com/organisation/submodule.git