启用2FA双因子认证后,git pull 时,报错:remote: HTTP Basic: Access denied remote: You can generate one at https://xxx.com/-/profile/personal_access_tokens
1、启用2FA双因子认证后,git.exe pull –progress -v –no-rebase “origin”
remote: HTTP Basic: Access denied
remote: You must use a personal access token with ‘read_repository’ or ‘write_repository’ scope for Git over HTTP.
remote: You can generate one at https://xxx.com/-/profile/personal_access_tokens
fatal: Authentication failed for ‘https://xxx.com/xgrit/object.git/’
git 未能顺利结束 (退出码 1) (5344 ms @ 2022/6/29 10:42:11)。如图1
2、打开:https://xxx.com/-/profile/personal_access_tokens ,生成 personal access token。如图2
3、再次拉取,弹出 Git Credential Manager 登录框。仍然报同样的错误。如图3
4、重新设置远程仓库地址,添加:oauth2:{personal_access_token}@。如图4
5、拉取成功,不再报错。
近期评论