一、问题描述
Username for ‘https://github.com': xxxxx
Password for ‘https://xxxx@qq.com@github.com':
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.
fatal: Authentication failed for ‘https://github.com/RobinWang825/RobinWang825.github.io.git/'
原先的密码凭证从2021年8月13日
开始就不能用了,必须使用个人访问令牌(personal access token)
,就是把你的密码
替换成token
!
二、如何生成token
- 进入github,右上角-Settings
- 下拉选择 Developer settings(开发者设置)
- 选择Pesonal access tokens(个人访问令牌)
- 设置token的Note, 有效期,范围。这里我都选的最大。
- 生成令牌 Generate token。==切记,生成后记得复制保存!!==
- 登录的时候在原先需要输入密码的地方,输入token即可。
也可以 把token直接添加远程仓库链接中,这样就可以避免同一个仓库每次提交代码都要输入token了:
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
:换成你自己得到的token :是你自己github的用户名 :是你的仓库名称
reference
https://blog.csdn.net/weixin_41010198/article/details/119698015
GitHub不再支持密码验证解决方案:SSH免密与Token登录配置:
https://cloud.tencent.com/developer/article/1861466
https://blog.csdn.net/weixin_42488513/article/details/120121769