git 提示error setting certificate verify locations 解决方案

时间:2023-03-08 20:48:28

问题:使用git extension 拉取或者push代码,提示

"C:\Program Files\Git\bin\git.exe" pull --progress "origin" +refs/heads/zjw
fatal: unable to access 'https://github.com/**/': error setting certificate verify locations:

CAfile: C:/Program Files/Git/mingw64/libexec/ssl/certs/ca-bundle.crt
CApath: none
Done

Press Enter or Esc to close console...

这是因为git 提交代码时需要安全认证,可以通过以下方法设置,取消验证

解决:

找到 git的config 配置文件,路径应该在 
C:\ProgramData\Git\config ,添加下面两行

[http]
    sslVerify = false
    sslCAinfo = /bin/curl-ca-bundle.crt

保存后,再提交代码就可以了。