执行git push -u origin main时遇http.sslverify配置错误,GitHub上传失败
解决Git推送时的"fatal: bad boolean config value 'true~' for 'http.sslverify'"错误
这个错误是因为Git的http.sslverify配置项被设置了无效的布尔值true~(多了个波浪线),导致Git无法解析配置。按以下步骤修复:
先检查全局Git配置中的该值:
git config --global --get http.sslverify如果输出是
true~,执行以下命令修正全局配置:git config --global http.sslverify true若全局配置没问题,进入你的项目仓库目录,检查本地仓库配置:
git config --local --get http.sslverify如果输出是
true~,执行命令修正本地配置:git config --local http.sslverify true也可以直接编辑配置文件:
- 全局配置文件:Linux/macOS路径为
~/.gitconfig,Windows路径为C:\Users\<你的用户名>\.gitconfig,找到[http]段下的sslverify = true~,改成sslverify = true - 本地仓库配置文件:项目根目录下的
.git/config,同样修改对应行
- 全局配置文件:Linux/macOS路径为
修复后再执行git push -u origin main即可正常推送代码到GitHub。
内容的提问来源于stack exchange,提问作者user19514686
相关产品推荐
相关产品推荐

