git 是使用ssh方式來連接的,所以,流程與linux的ssh連接是1樣的.所以只需要配置config文件就能夠到達目的;
1 打開當(dāng)前用戶根目錄(home目錄)下的.ssh,創(chuàng)建1個config文件名的text文件;
2 內(nèi)容比如編寫
#github的連接配置
Host github.com
User git
IdentityFile ~/.ssh/pc-k27-github.com-dsa⑵0150429.pri
3 git pull
就會提示使用那個key,如果有密碼就會提示輸入密碼
config的具體配置請在linux下 使用命令來查看:man ssh_config