git 无法将 sslVerify 设置为 false
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30636018/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unable to set the sslVerify to false
提问by carol dsouza
Actually I'm trying to install an ngCordova plugin for SQLite. But its giving me the error: Unknown SSL protocol error in connection to github.com:443 while accessing https://github.com/brodysoft/Cordova-SQLitePlugin.git/info/refsfatal: HTTP request failed. On doing some research, I came across the solution to set the sslVerify to false. I am not able to set the command git config http.sslVerify "false" using the command prompt. It is giving me the error: could not lock config file /.gitconfig: No such file or directory. I also tried doing it manually by editing the gitconfig file; but its not happening
实际上我正在尝试为 SQLite 安装一个 ngCordova 插件。但它给了我错误:连接到 github.com:443 的未知 SSL 协议错误,同时访问https://github.com/brodysoft/Cordova-SQLitePlugin.git/info/refs致命:HTTP 请求失败。在做一些研究时,我遇到了将 sslVerify 设置为 false 的解决方案。我无法使用命令提示符设置命令 git config http.sslVerify "false"。它给了我错误:无法锁定配置文件/.gitconfig:没有这样的文件或目录。我也尝试通过编辑 gitconfig 文件手动完成;但它没有发生
回答by 1337joe
The error message you mentioned from trying to set a configuration is printed when you try to set a local git configuration when you're not in a git repo. You'll need to either set a global (add --global
flag) configuration or cd into an existing git repo to set it to just that repo.
当您不在 git 存储库中时尝试设置本地 git 配置时,会打印您在尝试设置配置时提到的错误消息。您需要设置全局(添加--global
标志)配置或 cd 到现有的 git 存储库中以将其设置为该存储库。
Ideally you want to limit the scope of the sslVerify "false"
configuration, but if you're trying to get the initial clone you may need to set it as a global setting (temporarily) using:
理想情况下,您希望限制sslVerify "false"
配置的范围,但如果您尝试获取初始克隆,您可能需要使用以下方法将其设置为全局设置(临时):
git config --global http.sslVerify "false"
With that set you should be able to clone the repo, at which point I'd recommend unsetting it as a global configuration and setting it in your newly-cloned repo:
使用该设置,您应该能够克隆存储库,此时我建议将其取消设置为全局配置并将其设置在您新克隆的存储库中:
git config --global --unset http.sslVerify
cd <your newly-cloned repo>
git config http.sslVerify "false"
To verify what your configurations are set to after you're done you can run:
要在完成后验证您的配置设置为什么,您可以运行:
git config --global --list
git config --local --list