该错误在中明确描述HTTPS 克隆错误 https://help.github.com/articles/https-cloning-errors/
根据具体的错误消息,尝试在 url 中使用您的用户名进行克隆可能会有所帮助:
git clone https://<username>@github.com/<username>/<repo.git>
但理想情况下,你应该重新编译并安装更新版本的 Git https://stackoverflow.com/a/26706653/6309.
对于 Git 版本 2.12.0,错误消息为:
fatal: unable to access 'https://github.com/creationix/nvm.git/':
Problem with the SSL CA cert
确保您已安装证书:
sudo yum reinstall openssl ca-certificates -y
此修复的手动版本是:
mkdir -p /etc/pki/tls/certs
curl https://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/ca-bundle.crt
git config --global http.sslcainfo /etc/pki/tls/ca-bundle.crt
git config -l
Another 这里描述了方法 https://unix.stackexchange.com/a/346756/7490:
mkdir /usr/src/ca-certificates && cd /usr/src/ca-certificates
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/ca-certificates-2015.2.6-65.0.1.el6_7.noarch.rpm
rpm2cpio ca-certificates-2015.2.6-65.0.1.el6_7.noarch.rpm | cpio -idmv
cp -pi ./etc/pki/tls/certs/ca-bundle.* /etc/pki/tls/certs/
Note: edtech https://stackoverflow.com/users/1187553/edtech adds 在评论中 https://stackoverflow.com/questions/42447538/cant-clone-any-repository-using-git/42448428#comment86374871_42448428:
升级nss
包裹 (yum update nss
)为我解决了同样的问题。