项目场景:
进行git push时同步github库,输入用户名和密码之后出现
问题描述
遇到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号之后就移除了密码授权,而进入后面给出的网站查看之后就会发现:
总结起来就是密码处要填入你的personal access token
解决方案:
- 点击github头像,再点击settings
- 滑到最下面找到developer settings
- 点击生成personal access token(这里记得把权限全选,然后把token保存在一个文本文档里,因为是没法第2次查看的
- 然后再进行
git push
时在密码处复制粘贴自己的token就成功了
更多学习干货与资料领取欢迎关注公众号:洋芋智能