git 解决多个ssh提交到多个不同项目 multiple SSH Keys with different project

参考 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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,424评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,811评论 0 23
  • This project was bootstrapped with Create React App. Belo...
    unspecx阅读 5,214评论 0 2
  • origin websiteComparing WorkflowsCentralized Workflow Fea...
    伍帆阅读 521评论 0 0
  • 昨天,你早早的完成作业,比以前状态好,只是好久没做聪明题了!今天你没打招呼直接去了曹阿姨办公室!背诵的作业还没做就...
    岸笛飞声阅读 138评论 0 0