一、生成两对key,可以对文件进行重命名,避免文件名重复
二、.ssh目录下,新建config文件,编辑配置文件,内容如下
config文件
?
Host gitlab.lan HostName gitlab.lan IdentityFile C:\\Users\\javain\\.ssh\\id_rsa PreferredAuthentications publickey User testone
Host github.com HostName github.com IdentityFile C:\\Users\\javain\\.ssh\\id_rsa_github PreferredAuthentications publickey User testtwo
三、进入到对应的仓库需要设置用户名及email
?git config user.name "testone"
?git config user.email "xxx@xx.com"
?四、github报错
OpenSSL SSL_read: Connection was reset, errno 10054
把证书验证关闭即可
?git config --global http.sslVerify "false"
|