1、进入.ssh目录
2、重命名id_rsa及id_rsa.pub

  gitlab和github双账号设置

 

3、创建config文件,config内容如下:

#gitlab
Host gitlab.com
  HostName gitlab.com
  User xxx
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa_gitlab

#github
Host github.com
  HostName github.com
  User xxx
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa_github

4、设置提交用户名等

git config --global user.name "xxx"
git config --global user.email "xxx@xx.com"

5、cat id_rsa_gitlab.pub或 id_rsa_github.pub填入gitlab或github SSH Keys即可

相关文章:

  • 2022-12-23
  • 2021-06-17
  • 2021-07-17
  • 2021-07-30
  • 2021-10-16
  • 2021-09-28
  • 2021-10-22
猜你喜欢
  • 2022-12-23
  • 2022-02-27
  • 2021-12-26
  • 2022-01-09
  • 2021-06-19
  • 2022-01-13
  • 2021-11-28
相关资源
相似解决方案