1
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" -f ~/.ssh/id_rsa_github
id_rsa_github为.ssh路径下生成的文件名,如果有多个仓库网站的秘钥对需要配置,比如gitee,可以对应生成不同的文件名id_rsa_gitee
2
ssh-add ~/.ssh/id_rsa_github
添加到ssh配置
3
cat ~/.ssh/id_rsa_github.pub
查看公钥内容,复制到 github添加ssh秘钥页面
setting--ssh key--new ssh key
4
ssh -T git@gitee.com
验证,配置正确的话终端打印 You've successfully authenticated, but GitHub does not provide shell access.
这样就可以从github仓库进行git操作了