git - 如何将 core.sshCommand 选项传播到子模块更新?
问题描述
我已经core.sshCommand
为 repo 设置了选项,以便在使用它时可以使用不同的 ssh 密钥(即sshCommand = ssh -i /path/to/key
)。但是,当我运行git submodule update
此选项时,不考虑:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
有什么方法可以配置 repo 以将给定的 ssh 密钥用于自身和任何子模块?
解决方案
全局设置:
git config --global core.sshCommand "ssh -i /path/to/key"
但这为您使用的每个存储库设置了密钥。
或者为每个子模块设置它:
git submodule foreach git config core.sshCommand "ssh -i /path/to/key"
推荐阅读
- reactjs - 如何将资源放在其他组件中?
- c# - 如何创建 mvc 项目模板并在 VSIX 项目中使用它。项目中不存在目标“TemplateProjectOutputGroup”
- windows - 有没有办法在 Windows 热点上实现强制门户?
- selenium-webdriver - 如何获取放心的jsonPath().getMap方法返回的map值
- sql-server - 为什么我应该使用带有输出参数的存储过程
- python - 抛出错误:遇到未解决的自定义操作:Normalize.Node number 0 (Normalize) 准备失败
- c# - 如何从 GridView 中的特定行下载文件
- linux - 了解 Git 命令
- android-gridview - 我的网格视图中有一个按钮,我想在单击按钮(位于网格视图内部)时将数据发送到另一个活动
- java - 避免基本数学运算符的正则表达式