2021年8月13日之后使用git push會報下面這個錯:
fatal: HttpRequestException encountered.
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.
解決辦法:
1. 創建 private token,參考:https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
把 private token記下來下面要用。
2. 使用git 命令重定向遠程倉庫地址:
即 git remote set-url origin https://[private token] @github.com/[用戶名]/[倉庫名]
如,原來的倉庫地址是 https://github.com/zhangsan/project1.git,private token是abc,則使用指令:
git remote set-url origin https://abc@github.com/zhangsan/project1.git
轉載請注明出處:https://www.cnblogs.com/jietian331/p/15146108.html