github push 代码出现fatal: Authentication failed for ‘https://github.com/xxx/xxx.git/‘

fatal: Authentication failed for ‘https://github.com/xxx/xxx.git/’:

问题描述

想从服务器上push代码到github,遇见fatal: Authentication failed for 的问题,弄了很久终于解决。

我是第一次使用github上传代码,按照以下两个博客内容进行操作。

在git pull origin master步骤中出现身份验证通过的现象。

  1. 可能出现的解决方案:

网上查了一圈,大多都是说,这两个参数应该和github账户匹配,即username应该是github账户名字,email是github绑定邮箱。

git config --global user.name [username]
git config --global user.email [email]

我改正后依旧不行。始终出现以下问题

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/xxx/xxx.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.

原来人家已经提示了问题所在,而我一度以为是账户密码的问题,好傻缺,大概意思就是2021.8月份开始远程登录不在支持使用账户密码的方式。。。。。。。。发现这个问题后马上找到了解决方法。

##############2.真正的解决方法############

解决方法

链接: https://blog.csdn.net/yjw123456/article/details/119696726.

按照里面提示,将原来的

git remote add origin https://github.com/xxx/xxx.git

指令换成

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

的格式后成功解决这个问题。。

  • 4
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值