There is no problem not worth solving, and no technology not worth learning!

When 2FA two-factor authentication is enabled, when git pull is enabled, an error is reported: Remote: HTTP Basic: Access Denied Remote: You can generate one athttps://xxx.com/-/profile/personal_access_tokens

启用2FA双因子认证后,git.exe pull --progress -v --no-rebase "origin" fatal: Authentication failed

1. After enabling 2FA two-factor authentication, git.exe pull –progress -v –no-rebase “origin”
Remote: HTTP Basic: Access Denied
Remote: You must use a personal access token withREAD_REpositoryOrwrite_repositoryScope for git over http.
Remote: You can generate one athttps://xxx.com/-/profile/personal_access_tokens
Fatal: Authentication failed forhttps://xxx.com/xgrit/object.git/

Git failed to end smoothly (exit code 1) (5344 ms @ 2022/6/29 10:42:11). as shown in Figure 1

启用2FA双因子认证后,git.exe pull --progress -v --no-rebase "origin"  fatal: Authentication failed
Figure 1

2. Open:https://xxx.com/-/profile/personal_access_tokens, which generates Personal Access Token. as shown in Figure 2

打开:https://xxx.com/-/profile/personal_access_tokens ,生成 personal access token
Figure 2

3. Pull again, and the Git Credential Manager login box will pop up. The same error is still reported. as shown in Figure 3

再次拉取,弹出 Git Credential Manager 登录框。仍然报同样的错误
Figure 3

4. Reset the remote repository address and add: oauth2:{personal_access_token}@. as shown in Figure 4

重新设置远程仓库地址,添加:oauth2:{personal_access_token}@
Figure 4

5. If the pull is successful, no error will be reported.

Need long-term technical maintenance or remote troubleshooting?

I am a PHP / Go backend engineer with 15+ years of experience, focused on existing system maintenance, bug fixing, performance optimization, server troubleshooting, WordPress maintenance, and small feature iterations.

If your project is facing any of the following issues, we can start with a small troubleshooting task first:

  • ✅ PHP / Laravel / Yii2 legacy systems without active maintenance
  • ✅ Go / Gin backend APIs that need troubleshooting or optimization
  • ✅ Slow, broken, or unstable WordPress websites
  • ✅ Nginx / MySQL / Redis / Linux server issues
  • ✅ CDN / Cloudflare / DNS / HTTPS configuration problems
  • ✅ Long-term remote technical support or part-time maintenance

More details: About Me & Collaboration

WeChat: 13980074657
Email: shuijingwanwq@gmail.com
Telegram: @shuijingwan
GitHub: https://github.com/shuijingwan

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.