git 使用指定 ssh key

5,615 阅读1分钟

在仓库 clone 时指定key

git clone git@github.com:yoyun/hello.git --config core.sshCommand="ssh -i ~/.ssh/you_ssh_key"

在 config 中指定key

git config core.sshCommand "ssh -i ~/.ssh/you_ssh_key"