git报错和解决方案整理

错误1:remote: Support for password authentication was removed on xxx.

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

问题背景

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

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

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

问题解决

① 点击头像 选择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

错误2:RPC failed; curl 28 Recv failure: Connection was reset.

参考博客:https://blog.csdn.net/weixin_46134999/article/details/130836073

问题背景

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

error: RPC failed; curl 28 Recv failure: Connection was reset
fatal: expected flush after ref listing

问题解决

执行如下命令再克隆即可:

git config --global http.sslVerify "false"
posted @ 2021-11-13 16:09  Yu_tiann  阅读(5164)  评论(0编辑  收藏  举报