git更新代码报错
配置文件路径
C:\Users\rylinxu
下有个.gitconfig
文件,里面配置了
[user]
name = xrss
email = 6547954321@qq.com
[credential]
helper = manager-core
[http]
sslVerify = false
一、The requested URL returned error: 403
这表示我们没有权限pull、push
相关代码
有可能你是真的没有权限(认真脸)
- 你
修改了git仓库的用户名和密码
,导致你内存和硬盘中缓存的账号&密码
不能使用
1:remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
你原先的密码凭证从2021年8月13日开始就不能用了,必须使用个人访问令牌(personal access token),就是把你的密码替换成token!
2、如何生成自己的token
1、在个人设置页面
,找到Setting
2、选择开发者设置Developer setting
3、选择个人访问令牌Personal access tokens
,然后选中生成令牌Generate new token
4、设置token
的有效期,访问权限等
选择要授予此令牌token的范围或权限
。
- 要使用token从命令行访问仓库,请选择
repo
- 要使用token从命令行删除仓库,请选择
delete_repo
- 其他根据需要进行勾选
5、把token
直接添加远程仓库链接中
,这样就可以避免同一个仓库每次提交代码都要输入token
了:
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
<your_token>
:换成你自己得到的token<USERNAME\>
: 是你自己github的用户名<REPO\>
:是你的仓库名称
二、OpenSSL SSL_read: Connection was reset, errno 10054
打开GitBash
,修改设置,解除ssl验证
,输入:
git config --global http.sslVerify "false"