Github 之 Support for password authentication was removed...


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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM