Git修改密码后,命令行清空保存的旧密码

1. 问题现象

最近github强制废弃密码登录方式,改为使用token. 设置好token之后,git命令行并不提示输入新的token,仍然使用旧的密码尝试连接,并返回403失败。

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/yu-fei/pictures.git/': The requested URL returned error: 403

2. 解决方法

执行以下命令,清空之前存储的密码信息:

git config --system --unset credential.helper
git config --global credential.helper store

之后执行git push或者git pull就会提示输入用户名和新密码。

建站  ·  开发  ·  读书  ·  教程
↑长按或扫码关注“编程之海”公众号↑
↑长按或扫码关注“编程之海”公众号↑
编程之海 版权所有丨如未注明,均为原创丨转载请注明转自:https://codingsea.com/git-psd-restore/
0 0 投票数
文章评分
订阅评论
提醒
guest
0 评论
内联反馈
查看所有评论

0

0

1.59k

0
希望看到您的想法,请您发表评论x