赞
踩
Username for 'https://github.com': 4913xxxxx@qq.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/xxxxxxxion/xxxx-master-thesis.git/'
许久没有建仓,这个问题大概意思是你原先的密码凭证从2021年8月13日
开始就不能用了,必须使用个人访问令牌(personal access token)
,就是把你的密码
替换成token
!
1.首先在GitHub的个人设置页面,找到setting,选择开发者设置Developer setting
2.选择个人访问令牌Personal access tokens
,然后选中生成令牌Generate new token
选择要授予此令牌token的范围
或权限
。
repo
。delete_repo
。Generate token
git push
会报错。3.如下是生成的token
记得把你的token保存下来,因为你再次刷新网页的时候,你已经没有办法看到它了。
4.之后用自己生成的token登录,把上面生成的token粘贴到输入密码的位置,然后成功push代码!
在出现OpenSSH的时候,输入刚刚生成的token。
成功的界面
5.也可以把token
直接添加远程仓库链接中,这样就可以避免同一个仓库每次提交代码都要输入token了:
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
<your_token>
:换成你自己得到的token
<USERNAME>
:是你自己github
的用户名
<REPO>
:是你的仓库名称
git remote set-url origin https://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@github.com/creation/master-thesis.git/
参考的解决方法:remote: Support for password authentication was removed on August 13, 2021.
refusing to allow a Personal Access Token to create or update workflow [duplicate](有用,可以解决)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。