Git无法push,报Password authentication is temporarily disabled as part of a brownout

问题描述

今天写了点儿学习设计模式的代码,可是在push的时候报错了

$ git push
remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead.
remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information.
fatal: unable to access 'https://github.com/zjxht62/learnJava.git/': The requested URL returned error: 403

大体意思是,之前的使用密码的验证方式已经不能再使用了。
点开他提示的连接,看看
https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/

其中主要说的就是现在有很多新的安全改进,比如双重身份验证、登录警报等,但是还是有很多老用户仍然使用用户名和密码来操作Git,这不安全!现在不让你们用用户名加密码来验证了,要用access token了。

解决

所以你得先去生成个access token。

可以参考这个页面。https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

生成之后,由于我自己之前执行了下面的命令,设置了存储登录凭据(默认存储在~/.git-credentials)

git config --global credential.helper store

所以我需要执行下面这条命令来清除已存储的信息

git config --global --unset credential.helper

再次执行git push,会提示输入用户名和密码,这里密码就输入刚才生成的access token即可

$ git push
Username for 'https://github.com': zjxht62
Password for 'https://zjxht62@github.com':

之后再次保存一下

git config --global credential.helper store
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值