一、问题描述

正如题目所言,笔者使用git clone克隆GitHub一个项目时遇到以下报错,分析过可能的原因和解决方案后将其记录如下。

执行语句:git clone https://github.com/chenxuhao/GraphMiner
报错如下:gnutls_handshake() failed: The TLS connection was non-properly

Cloning into 'GraphMiner'...
fatal: unable to access 'https://github.com/chenxuhao/GraphMiner/': gnutls_handshake() failed: The TLS connection was non-properly terminated.


二、解决方案

网上说是代理的问题,解决了我遇到问题的方法为方法1:

  1. 解决方法①:
    执行如下语句来取消代理 👇

    git config --global --unset https.https://github.com.proxy 
    git config --global --unset http.https://github.com.proxy 
    

    项目克隆成功 👇
    在这里插入图片描述

  2. 解决方法②:
    去掉中间的方法一语句中的--unset执行,意思是使用如下代理,语句如下:

    git config --global https.https://github.com.proxy 
    git config --global http.https://github.com.proxy 
    
  3. 解决方法③
    问题描述:没有设置任何代理并且在使用git push时遇到gnutls_handshake() failed,可能是与curl相关的软件出了问题,解决方法为更新apt-get并重装curl
    解决方法 👇
    执行以下语句后再次提交git push

    apt-get update
    apt-get install curl 
    
  4. 解决方法④
    可能是gitconfig的配置出了问题,删除配置文件。
    执行如下语句 👇

    rm -rf ~/.gitconfig
    

三、总结

以上就是git clone 时出现gnutls_handshake() failed解决方法,本文记录了几种可能的解决方案,并利用所提供的解决方案解决了笔者所遇到的问题。
如果本文能给你带来帮助的话,点个赞鼓励一下作者吧!

四、引用参考

[1] 解决方法1:https://blog.csdn.net/huanglin6/article/details/119799994
[2] 解决方法2:评论区https://blog.csdn.net/shaopeng568/article/details/114919318
[3] 解决方法3:https://blog.csdn.net/u013895878/article/details/123724019
[4] 解决方法4:https://blog.csdn.net/PedestrianZQZ/article/details/123297617

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐