GitHub推代码报错:Support for password authentication

  • 问题描述:
    推送代码到Github时提示:remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
  • 问题原因:
    简而言之,从2021年8月13日开始,为了提高安全性,Git弃用了原先的密码凭证,必须使用personal access token(个人访问令牌)代替
    有兴趣的童鞋可以戳下面了解下:
    Git官网解释
  • 解决方法:
    github进入个人设置Settings -》 Developer settings :
    image.png

    -》Personal access tokens -》Generate new token :
    image.png

    设置token有效期,根据需要勾选相关权限:
    ![image.png](https://upload-images.jianshu.io/upload_images/23776959-7c7cf0186c8631a5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

生成令牌:

image.png

生成结果:
image.png

复制该token,在对应的仓库目录下执行以下命令:
git remote set-url origin https://你刚才复制的token@github.com/你的用户名/git仓库名称.git
即在原来的git仓库地址中将该token添加到github.com前面。
搞定收工。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容