当前位置:   article > 正文

git使用https方式登录失效The provided password or token is incorrect or your account has 2FA enabled and you

the provided password or token is incorrect or your account has 2fa enabled

git使用https方式登录失效

报错信息

拉取代码报错git pull
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password.

原因

登录认证失败,但本机存储了git的账号密码所以提示错误。一般是token过期了

解决方法

再私有库github上重新生成token,然后清除本地账户信息缓存,重新配置账户和密码

清理本地账户信息

git config --system --unset credential.helper
git config --global credential.helper wincred
  • 1
  • 2

清除掉缓存在git中的用户名和密码

git credential-manager uninstall
  • 1

设置本地存储,目的是输入一次账号密码下次不用再输入了

git config --global credential.helper store

再次使用git pull会提示输入账号、密码(token)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/974617
推荐阅读
相关标签
  

闽ICP备14008679号