git配置ssh登陆后,却一直提示要输入密码

###github配置SSH免密登录
更换后ssh密匙后提交代码到GitHub一直失败,不知道为什么设置Personal access tokens也一直验证失败,账号密码的登录方式根据对应文档已经废弃,最后重置了远程仓库地址遂成功

git remote rm origin
git remote add origin [url]      # 对应的SSH url

后续
不知为何我的ssh登录又失效了提示要验证账号密码或者使用token登录 通过git config --get remote.origin.url查看发现我的地址居然是https, 所有更改一下remote协议即可

git config --get remote.origin.url      # 查看远程协议
git remote set-url [email protected]:18639710721/CS61A.git   # 设置GitHub中对应的ssh地址

参考

猜你喜欢

转载自blog.csdn.net/weixin_45650075/article/details/130831367