如何对git子模块使用相同的协议?

曼努埃尔·塞尔瓦(Manuel Selva)

在git仓库RI中,有一个子模块,我使用以下命令初始化了该子模块:

git submodule add git@mygitserver...

现在,用户只是使用复制了R,https并在运行时出现错误

git submodule init
git submodule update

因为他没有ssh(在服务器上上传了公共密钥)访问权限。所以我的问题是,是否有可能创建一个子模块,该子模块将自动使用与用于在git submodule update命令上克隆父存储库的协议相同的协议

该用户可以设置配置:

git config --global url.https://mygitserver/.insteadOf ssh://git@mygitserver/
# or possibly (to be tested)
git config --global url.https://mygitserver/.insteadOf git@mygitserver/

这样,https URL将始终用于mygitserver(主存储库或子模块),而不是ssh。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章