【解决】remote: Support for password authentication was removed on August 13, 2021

背景:

突然无法上传代码到git了,报如下错误:

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/EdenLiu/TestCode.git/'
 

解决方案:

需要使用token进行权限校验才能重新使用git.

按照官网教程处理

生成Token

setting ->Developer settings->personal access tokens->Generate new token

 

 Note自己想写啥写啥,超时时间自用的话可以选 永久,复选框自用的话就都选上,最后点击generate token.

 生成如下图:

主要保存到token,下次再进来就再也看不到了

应用Token

 修改现有项目的url

git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git

<your_token>换成你自己得到的令牌。<USERNAME>是你自己github的用户名,<REPO>是你的项目名称,比如: 

git remote set-url origin https://ghp_wYAehQdyYEMXKLxJ3Z2F5ZwQF39LTZ2wyWUw@github.com/EdenLiu/TestCode.git

就OK了

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值