BUG解决:fatal: Authentication failed for ‘https://github.com/xxx/xxx/‘

项目场景:

进行git push时同步github库,输入用户名和密码之后出现


问题描述

遇到fatal: Authentication failed for 'https://github.com/xxx/xxx/'报错,
fatal: Authentication failed for 'https://github.com/xxx/xxx/'

详细报错如下

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

试过git config还是不行


原因分析:

刚开始看到可能会很懵,但仔细看报错信息

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.

翻译过来就是2021年8月31号之后就移除了密码授权,而进入后面给出的网站查看之后就会发现:
BUG解决:fatal: Authentication failed for ‘https://github.com/xxx/xxx/‘_第1张图片
总结起来就是密码处要填入你的personal access token


解决方案:

  1. 点击github头像,再点击settings
    BUG解决:fatal: Authentication failed for ‘https://github.com/xxx/xxx/‘_第2张图片
  2. 滑到最下面找到developer settings
    BUG解决:fatal: Authentication failed for ‘https://github.com/xxx/xxx/‘_第3张图片
  3. 点击生成personal access token(这里记得把权限全选,然后把token保存在一个文本文档里,因为是没法第2次查看的

BUG解决:fatal: Authentication failed for ‘https://github.com/xxx/xxx/‘_第4张图片

  1. 然后再进行git push时在密码处复制粘贴自己的token就成功了
    在这里插入图片描述

更多学习干货与资料领取欢迎关注公众号:洋芋智能

你可能感兴趣的:(bug,git,github)