我目前正在尝试处理 git 子模块,但当我想将修改推送到子存储库时遇到了麻烦。
我收到以下错误:
fatal: remote error:
You can't push to git://github.com/yllieth/ui.git
Use https://github.com/yllieth/ui.git
事实上,如果我将远程配置更改为使用 HTTPS 而不是 ssh 公钥,它就可以正常工作。但我想避免提供我的 github 的用户名/密码。
有人知道一些配置技巧或其他东西可以使用我的公钥推送到子模块吗?
最佳答案
It's working fine if I change my remote configuration to use HTTPS instead of ssh public key.
请注意git://github.com/yllieth/ui.git
不是 ssh URL。
请参阅“Which remote URL should I use?”和“Changing a remote's URL”:
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1e79776a5e79776a766b7c307d7173" rel="noreferrer noopener nofollow">[email protected]</a>:username/reponame.git
会的。
在您的情况下:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e0878994a0878994889582ce838f8d" rel="noreferrer noopener nofollow">[email protected]</a>:yllieth/ui.git
所以你仍然可以使用 ssh,但是你需要change the submodule url .
关于git - 如何在不提供用户名/密码的情况下推送对 git 子模块的修改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25998653/