当拥有多个git服务器,而且都是用ssh认证方式时,需要在~/.ssh下的config文件做如下配置

如下:第一个为本地git库,第二个为github库,第三个为默认git库

Host 192.168.1.12
  IdentityFile ~/.ssh/ying
  User ying

Host github.com
IdentityFile ~/.ssh/id_rsa.another
User anotherUser

Host *
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/id_rsa

 

相关文章:

  • 2021-12-31
  • 2022-01-20
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2020-09-25
  • 2021-12-14
  • 2022-02-06
猜你喜欢
  • 2021-07-04
  • 2021-05-29
  • 2021-07-16
  • 2021-08-27
  • 2021-08-09
  • 2021-06-19
相关资源
相似解决方案