我想在一行中执行此命令:
git pull && [my passphrase]
怎么做?
最佳答案
这不完全是您要求的,而是针对 http(s) 的:
https://user:pass@domain/repo
克隆 repo 但这不是真正推荐的,因为它会在很多地方显示你的用户/密码...... 凭证助手的使用示例
git config credential.helper store
- 无限期地存储凭证。 git config credential.helper 'cache --timeout=3600'
- 存储 60 分钟 对于基于 ssh 的访问,您将使用 ssh 代理,该代理将在需要时提供 ssh key 。这需要在您的计算机上生成 key ,将公钥存储在远程服务器上并将私钥添加到相关 keystore 。
关于git - 如何为git pull输入带有密码的命令?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11506124/