场景:
# git push
Username for 'https://github.com': bboyhan
Password for 'https://bboyhan@github.com':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes
of authentication.
fatal: Authentication failed for 'https://github.com/bboyHan/xxxx.git/'
原因:
从 21 年 8 月 13 后不再支持用户名密码的方式验证,而需要创建个人访问令牌(personal access token)。
解决办法:
从Github上生成令牌,用于仓库代码提交等操作;
github -> settings -> Developer settings -> Personal access tokens -> generate new token
生成一个,权限根据你自己的需要自行选择,生成之后的token:
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
解决~
技术交流与资源分享(博主Q微同号: 446794914),感兴趣的朋友欢迎交流。