项目场景
使用 git clone 命令从 GitHub 克隆一个仓库到本地:
git clone https://github.com/XavierJiezou/ys-dl.git
问题描述
$ git clone https://github.com/XavierJiezou/ys-dl.git
Cloning into 'ys-dl'...
fatal: unable to access 'https://github.com/XavierJiezou/ys-dl.git/': SSL certificate problem: unable to get local issuer certificate
报错信息翻译:SSL证书问题:无法获取本地颁发者证书。
解决方案
git config --global http.sslverify false
打开终端,执行上述命令后成功解决问题:
$ git config --global http.sslverify false
$ git clone https://github.com/XavierJiezou/ys-dl.git
Cloning into 'ys-dl'...
remote: Enumerating objects: 146, done.
remote: Counting objects: 100% (146/146), done.
remote: Compressing objects: 100% (108/108), done.
Receiving objects: 82% (120/146)
Receiving objects: 100% (146/146), 822.00 KiB | 2.00 MiB/s, done.
Resolving deltas: 100% (71/71), done.
原因分析
既然报错说是 SSL 证书有问题,那我们跳过证书验证就行了。
引用参考
Git - git-config Documentation
|