我有一个包含 3 个子模块的存储库。 repo 和子模块都在同一台服务器上,我可以通过 ssh 访问它。远程 URL 是:
ssh://mm@theserver.com/path/to/sub1.git
ssh://mm@theserver.com/path/to/sub2.git
ssh://mm@theserver.com/path/to/sub3.git
如果我执行诸如 git submodule update --remote
之类的操作,它会提示我输入密码 3 次。
有什么方法可以更新子模块但只需要密码一次吗?提交更改等也是如此。
最佳答案
减少头痛的解决方案
另一种方法是使用内置的 git cache (需要 1.7.10 或更高版本)所以 git 会在您第一次提供后记住您的登录名和密码。
启用默认超时(15 分钟)的 git 缓存
git config --global credential.helper cache
更改默认超时类型
git config --global credential.helper 'cache --timeout=3600'
关于git - 避免为每个子模块重新输入密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30180751/