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

我是在 clone 的时候出现的错误,报错信息如下
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.git/'

注意审题:意思是使用密码登录这种方式已经在2021年8月13日失效了需要在 github 上生成token登录令牌替换掉密码来进行登录

至于如何生成这个token这个大家可以自行查询一下,今天时间有限就不讲了,等抽出时间之后再补充(可以先参考 这个链接 https://blog.csdn.net/weixin_41010198/article/details/119698015),现在只讲拿到token之后怎么操作
报错这个token因为可能以后重新clone新项目的时候还会遇到这种问题

搜索的答案无非就是这样:

解决方案,重新执行git config命令配置用户名和邮箱即可:

git config --global user.name "xxx"   
git config --global user.email "[email protected]"  

但是有时候没用啊,这里面有一点小坑的地方就是这个 --符号最好自己手动输入不要直接 copy
然后又一个坑点来了,如果设置完成之后再一次去clone代码会让你输入usernamepassword 这里的 password 不要真的去使用你的登陆的密码要使用刚刚你保存下来的 token 才可以不然还是报错,不仅报错而且还会让你发懵怀疑人生
这样之后应该就大功告成了,至于如何生成令牌的问题,等我抽个时间再去补充.
可以先参考 这个链接 https://blog.csdn.net/weixin_41010198/article/details/119698015
希望可以帮助你

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