Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to pull/push in git repository

$ 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.

like image 290
Arvind Avatar asked Dec 29 '15 11:12

Arvind


People also ask

Why git push is not working?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

Why git pull is not working?

This might be happening because of some conflict files present in your repository . And you was still trying to check in files . So After that what happen , it will check in your local repository not in master repository . So u was not able to pull or check in anythings in master(head) repository .

Why can't I push code to GitHub?

To push a branch on remote, your branch needs to have the latest changes present in remote repository. If you get the failed to push error, first do git pull the branch to get the latest commits and then push it.


2 Answers

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

like image 110
CodeWizard Avatar answered Oct 09 '22 03:10

CodeWizard


I once had the same problem. My problem occured after re-installing git for windows. I'm using git for windows 64-bit on windows 10.

I found out that the installer did not install git anymore in C:/Users/[USER_NAME]/AppData/Local/Programs/Git. Instead it installed it under C:\Program Files\Git.

Nevertheless the old config file C:\ProgramData\Git\config was not edited by the installer. This file still contains the old path so I edited it manually.

E.g. on my system I used

[http]
     sslCAInfo = C:/Programme/Git/mingw64/ssl/certs/ca-bundle.crt

maybe you will have to use Program Files instead

     sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt

EDIT

Like DS said in his comment

C:\ProgramData\Git\config needs to be edited as Administrator.

E.g. right click on notepad and select "Run as Administrator" then open the file.

like image 27
René Link Avatar answered Oct 09 '22 02:10

René Link