一台机器同时关联两个git仓库

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_31617409/article/details/82085843
  1. 在.ssh目录下面重新生成新的私钥和公钥。名称不要重复
  2. 在.ssh目录下面新建config文件,其配置如下:
Host github.com #default set

    HostName github.com

    IdentityFile ~/.ssh/id_rsa



Host github_second #custom set

    HostName github.com

    IdentityFile ~/.ssh/id_rsa_second

3、进行仓库关联的时候运行命令:

git remote add origin git@github_second:RayHauton/ScheduleManagerApp.git

即可:Complete!

猜你喜欢

转载自blog.csdn.net/qq_31617409/article/details/82085843