gpt4 book ai didi

git - 无法使用 git 克隆任何存储库

转载 作者:太空狗 更新时间:2023-10-29 14:27:52 27 4
gpt4 key购买 nike

我尝试克隆了几个存储库,但总是出现相同的错误。我在哪里可以找到有关此错误的更多信息(错误日志文件或类似文件),或者有人知道哪里出了问题?

# git clone http://github.com/creationix/nvm.git .nvm
Initialized empty Git repository in /home/marcin/.nvm/.git/
error: while accessing http://github.com/creationix/nvm.git/info/refs

fatal: HTTP request failed

# git clone https://gitlab.com/jmis/exilecraft.git
Initialized empty Git repository in /home/marcin/exilecraft/.git/
error: while accessing https://gitlab.com/jmis/exilecraft.git/info/refs

fatal: HTTP request failed

我正在使用 CentOS 6.8 和 Git 1.7.1

------------ 编辑
将 Git 升级到 2.12.0 后出现错误消息:

# git clone https://github.com/creationix/nvm.git .nvm
Cloning into '.nvm'...
fatal: unable to access 'https://github.com/creationix/nvm.git/': Problem with the SSL CA cert (path? access rights?)

最佳答案

HTTPS cloning errors 中清楚地描述了该错误

根据确切的错误消息,尝试在 url 中使用您的用户名进行克隆可能会有所帮助:

git clone https://<username>@github.com/<username>/<repo.git>

但理想情况下,您应该 recompile and install a more recent version of Git .

对于 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

另一个approach is described here :

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/

备注:edtech添加 in the comments :

Upgrading the nss package ( yum update nss ) has solved the same problem for me.

关于git - 无法使用 git 克隆任何存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42447538/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com