我正在尝试使用https-URL克隆我的GitHub项目,但它失败并出现错误:
$ git clone https://foo@github.com/foo/foo-private.git
Cloning into foo-private...
Password:
error: error setting certificate verify locations:
CAfile: /bin/curl-ca-bundle.crt
CApath: none
while accessing https://foo@github.com/foo/foo-private.git/info/refs
fatal: HTTP request failed
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
mst*_*rap 284
我在Windows上看过这个,有msysgit 1.7.2.3.您必须修复bin/curl-ca-bundle.crt的路径.我必须使用反斜杠指定绝对路径:
git config --system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"
或者 - 不是真的推荐 - 您可以选择通过执行以下命令完全关闭SSL检查:
git config --system http.sslverify false
对于这两种情况,这将导致对[git-install-dir]/etc/gitconfig文件的更改,也可以直接编辑.
(在http://github.com/blog/642-smart-http-support上找到原始解决方案)
小智 74
我解决了安装Git的问题:https://git-for-windows.github.io/ 找到证书文件路径:
D:\ Program Files\Git\mingw64\ssl\certs\ca-bundle.crt
配置Git路径:
git config --system http.sslcainfo"D:\ Program Files\Git\mingw64\ssl\certs\ca-bundle.crt"
再试一次
Coo*_*ppo 21
只需使用以下命令安装证书包:
pacman -S mingw-w64-i686-ca-certificates ca-certificates
Run Code Online (Sandbox Code Playgroud)
pacman -S mingw-w64-x86_64-ca-certificates ca-certificates
Run Code Online (Sandbox Code Playgroud)
小智 12
如果您使用的是Cygwin,则可以使用apt-cyg安装ca-certificates包 :
wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /usr/local/bin
apt-cyg install ca-certificates
Run Code Online (Sandbox Code Playgroud)
git config --global http.sslverify "false"
Run Code Online (Sandbox Code Playgroud)
会解决问题.之后会出现一个弹出窗口,输入您的用户名和密码
小智 7
已解决:我在安装Git Windows安装程序更新时出现此错误.发生的事情是我没有使用管理员权限安装它,因此Git安装在"C:\ Users\my_name\AppData\Local\Programs"而不是"C:\ program Files"中.重新安装Git作为管理员允许将它放在C:\ program Files中,一切都恢复正常!
小智 5
这对我有用(我正在使用Manjaro linux).我运行cmd来查看ca证书:
$ curl-config --ca
**/etc/ssl/certs/ca-certificates.crt**
Run Code Online (Sandbox Code Playgroud)
但实际上我在路径上找到了证书:
**/etc/ca-certificates/extracted/ca-bundle.trust.crt**
Run Code Online (Sandbox Code Playgroud)
然后将配置添加到〜/ .gitconfig中(如果不存在,则创建它):
**vim ~/.gitconfig**
[http]
sslVerify = true
sslCAinfo = /etc/ca-certificates/extracted/ca-bundle.trust.crt
[user]
email = <email of github account>
name = <username of github account>
Run Code Online (Sandbox Code Playgroud)
有用!
.rbenv]$ git pull
remote: Counting objects: 70, done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 70 (delta 39), reused 12 (delta 12), pack-reused 6
Unpacking objects: 100% (70/70), done.
From https://github.com/sstephenson/rbenv
c43928a..efb187f master -> origin/master
+ 37ec781...7e57b52 user-gems -> origin/user-gems (forced update)
Updating c43928a..efb187f
Fast-forward
libexec/rbenv-init | 4 ++--
libexec/rbenv-version-file | 1 +
test/init.bats | 2 +-
test/test_helper.bash | 25 +++++++++++++++----------
4 files changed, 19 insertions(+), 13 deletions(-)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
141072 次 |
最近记录: |