1、github代理
$ ssh-keygen -t rsa -C "xxx@qq.com"
Generating public/private rsa key pair.
Your identification has been saved in /c/Users/admin/.ssh/id_rsa_github
Your public key has been saved in /c/Users/admin/.ssh/id_rsa_github.pub
#查看代理
$ ssh-add -l
Could not open a connection to your authentication agent.
#没有代理,创建代理
$ exec ssh-agent bash
$ ssh-add -l
The agent has no identities.
#本地添加私钥
$ ssh-add ~/.ssh/id_rsa_github
Identity added: /c/Users/admin/.ssh/id_rsa_github (xxx@qq.com)
$ ssh-add -l
3072 SHA256:LUXavAY3dnEdHxxxxxxxxxxxxxxxxxxxxx xxx@qq.com (RSA)
#github上添加公钥
#在github上配置上SSHKEY(id_rsa_github.pub)
#配置完成之后可以看到可以连通github了
$ ssh -T git@github.com
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
有时候git连不上 看是否是用户或者邮箱变了,如果是修改后重试
git config user.name
git config user.email