在 ~/.ssh/config 中添加配置
1 | Host github.com |
使用环境变量 GIT_SSH_COMMAND
1 | GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example" git clone example |
在仓库clone时指定key
1 | git clone git@github.com:yoyun/hello.git --config core.sshCommand="ssh -i ~/.ssh/you_ssh_key" |
在config中指定key
1 | git config core.sshCommand "ssh -i ~/.ssh/you_ssh_key" |