当我们在工作的时候,一个仓库可能满足不了我们的需求,我们就需要在电脑里配置多个仓库。
- 生成密钥
ssh-keygen -t rsa -C “你的邮箱号”
- 将自己的本地环境和GitHub进行连接起来(详情请看git的基本使用)
- 创建一个config文件注:没有拓展名
Host github
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_github
Host coding
HostName coding.net
User git
IdentityFile ~/.ssh/id_rsa
我们已经配置好了,下面我们进行配置
- 我们在桌面创建一个GitHub文件夹和coding文件夹
首先我们进行测试GitHub
如果在push的时候报错
ssh-add ~/.ssh/id_rsa_github
现在GitHub上面就有了
测试coding