Git 克隆仓库报unable to get local issuer certificate错误解决方法

 Git 克隆仓库报unable to get local issuer certificate错误解决方法

By:授客 QQ1033553122

 

问题描述

克隆gitlab上的仓库,报错,如下

 

$ git clone https://gitlab.xxx.net/qa/casstestmanage.git

Cloning into 'casstestmanage'...

fatal: unable to access 'https://gitlab.xxx.net/qa/casstestmanage.git/': SSL certificate problem: unable to get local issuer certificate

 

 

原因分析

这是由于当你通过HTTPS访问Git远程仓库的时候,如果服务器上的SSL证书未经过第三方机构认证,git就会报错。因为未知的没有签署过的证书意味着可能存在很大的风险

解决办法

设置关闭SSL验证

步骤1:

$ env GIT_SSL_NO_VERIFY=true git clone https://gitlab.xxx.net/qa/casstestmanage.git

Cloning into 'casstestmanage'...

warning: You appear to have cloned an empty repository.

 

 

步骤2:

进入到上述仓库目录下执行 git config http.sslVerify false命令,以便执行其它命令时不报上述错误

$ cd casstestmanage

$ git config http.sslVerify false

 

命令相关说明:

git config --global http.sslverify false 命令的影响范围是系统当前用户

 

 

git config --system http.sslverify false,命令的影响范围是全局所有用户

 

git config http.sslverify false 命令影响范围仅针对当前仓库,需要在对应仓库目录下执行:

 

 

猜你喜欢

转载自www.cnblogs.com/shouke/p/12868316.html
今日推荐