Unable to pull/push in git repository

Arvind picture Arvind · Dec 29, 2015 · Viewed 57.4k times · Source
$ git pull origin master
fatal: unable to access 'https://xxxxxxxxxxxxxxx': 
      error setting certificate verify locations:
CAfile: C:/Users/abc/AppData/Local/Programs/Git/usr/bin/curl-ca-bundle.crt
CApath: none

I am getting this error when I pull or push my code.

Please guide me to fix this.

Answer

CodeWizard picture CodeWizard · Dec 29, 2015

When using https you will need to supply password or using a certificate. In your case looks like the certificate is not a valid one.

Try fixing it like this by telling git where to find the certificate:

// Add the certificate to your configuration file
git config --system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"

Alternatively, you could disable SSL checks:

// or switch off SSL checks completely by executing:
git config --system http.sslverify false

Set this in your config to disable it only for the given url and not for all requests

[http "https://weak.example.com"]
    sslVerify = false

http.sslVerify

Whether to verify the SSL certificate when fetching or pushing over HTTPS.


http.sslCAInfo

File containing the certificates to verify the peer with when fetching or pushing over HTTPS