一台电脑配置多个git账号注意事项

生成sshkey的时候指定不同的名称

 

.ssh/config 文件示例如下,ForwardAgent如果去掉发现不通,需要加上,原因暂时未知

Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa
  ForwardAgent yes

Host gitlab.****.com
  HostName gitlab.****.com
  User git
  IdentityFile ~/.ssh/id_rsa_****
  ForwardAgent yes

 

posted @ 2025-04-28 17:12  冬音  阅读(18)  评论(0)    收藏  举报