美文网首页
GitHub推代码报错:Support for password

GitHub推代码报错:Support for password

作者: 飞往卓越之路 | 来源:发表于2022-01-17 17:53 被阅读0次
  • 问题描述:
    推送代码到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://img.haomeiwen.com/i23776959/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前面。
搞定收工。

相关文章

网友评论

      本文标题:GitHub推代码报错:Support for password

      本文链接:https://www.haomeiwen.com/subject/zyqkcrtx.html