【git】git clone 时出现gnutls_handshake() failed解决方法

ThanksView 2022-07-14 19:05:47
一、问题描述

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

root@EE:/opt/Koh3399# git clone https://github.com/friendlyarm/rkbin -b friendlyelec
正克隆到 'rkbin'...
fatal: unable to access 'https://github.com/friendlyarm/rkbin/': gnutls_handshake() failed: Error in the pull function

二、解决方案

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

    解决方法①:

    执行如下语句来取消代理


    git config --global --unset https.https://github.com.proxy
    git config --global --unset http.https://github.com.proxy
 
    项目克隆成功


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

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


解决方法③
问题描述:没有设置任何代理并且在使用git push时遇到gnutls_handshake() failed,可能是与curl相关的软件出了问题,解决方法为更新apt-get并重装curl。
解决方法

执行以下语句后再次提交git push

apt-get update

apt-get install curl



解决方法④
可能是gitconfig的配置出了问题,删除配置文件。
执行如下语句

      rm -rf ~/.gitconfig

三、总结

以上就是git clone 时出现gnutls_handshake() failed解决方法,本文记录了几种可能的解决方案,并利用所提供的解决方案解决了笔者所遇到的问题

回帖列表
4111111111111111 2025-03-30 08:27:43
1
4111111111111111 2025-03-30 08:27:38
1
4111111111111111 2025-03-30 08:26:29
1
4111111111111111 2025-03-30 08:26:28
1
1/ 1
粤ICP备18089419号