admin管理员组

文章数量:1648966

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

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

git credential-manager uninstall

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

git config --global credential.helper store

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

本文标签: 方式PasswordGitHTTPSToken