一般公司都會有自己的代碼倉庫,當然也有免費公開的代碼倉庫Github,Gitlab,這樣可能導致我們有多個代碼倉庫需要管理。在代碼倉庫上都會配置自己的ssh-key的公鑰,在連接倉庫的時候指定自己的私鑰即可。
可以在git的配置文件中指定:
vim ~/.ssh/config
Host xxx.com
IdentityFile ~/.ssh/id_rsa_ibbase_rsa
IdentitiesOnly yes
Host yyy.com
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
然後再使用git克隆對應域名下的倉庫就可以了