解决git push提示“remote: Support for password authentication was removed on August 13, 2021.“

场景:

# 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),感兴趣的朋友欢迎交流。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值