- 使用 git remote rm origin 命令移除HTTPS的方式
- 使用命令 git remote add origin git地址(ssh链接) 新添加上SSH方式
- 还是使用 git remote -v 命令,再次查看 clone 的地址,会发现git使用的方式变成了SSH方式
- config –global user.name “xxxxx”
- git config –global user.email “xxx@xx.xxx”
注:查下是否配置成功,用命令
git config --global --list
2.生成秘钥
ssh-keygen -t rsa -C “上面的邮箱”
注:执行上面命令后,连续回车3次
- cd ~/.ssh
- cat id_rsa.pub
打开设置。添加ssh
参考文章:
https://blog.csdn.net/xt199711/article/details/111812468
https://blog.csdn.net/xuaner8786/article/details/87872305



