git报错:remote: Support for password authentication was removed on August 13, 2021.


参考博客:https://blog.csdn.net/yjw123456/article/details/119696726

1、问题背景

在使用git提交代码时,发现有如下报错:

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

意思是:意思是自从21年8月13后不再支持用户名密码的方式验证了,需要创建个人访问令牌(personal access token)

2、问题解决

① 点击头像 选择Settings

image


② 左侧栏中选择 Developer settings

image


③ 栏目中选择 Personal access tokens

image


④ 点击Generate new token

image


⑤ 填写选项

如果只是给自己使用的话,可以直接选择无限的有效期
image
另外,后面的一些权限,为了方便也可以全部勾选,再点击最后的Generate token生成令牌


⑥ 将生成的令牌拷贝下来,并且保存


⑦ 修改现有项目的url(注意在复制这条指令的时候,把汉字改成对应的内容之后,要把将括号删掉哦)

git remote set-url origin https://<你的令牌>@github.com/<你的git用户名>/<要修改的仓库名>.git


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM