美文网首页
git 解决多个ssh提交到多个不同项目 multiple SS

git 解决多个ssh提交到多个不同项目 multiple SS

作者: SaintKnight | 来源:发表于2019-04-25 14:58 被阅读0次

参考 https://www.jianshu.com/p/33d72b87452d

我有个黑科技办法
参考
core.sshCommand If this variable is set, git fetch and git push will use the specified command instead of ssh when they need to connect to a remote system. The command is in the same form as the GIT_SSH_COMMAND environment variable and is overridden when the environment variable is set.
首先需要确认 git remote -v 是不是ssh连接
然后执行
git config --local --add core.sshCommand 'ssh -i /path/to/private'
之后就可以使用定制的私钥位置访问了

或者残暴点
GIT_SSH_COMMAND='ssh -i private_key_file' git pull

相关文章

网友评论

      本文标题:git 解决多个ssh提交到多个不同项目 multiple SS

      本文链接:https://www.haomeiwen.com/subject/dzhzgqtx.html