【git】git clone 时出现gnutls_handshake() failed解决方法
2022-07-14 19:05:47
ThanksView
  • 访问次数: 229
  • 注册日期: 2019-03-19
  • 最后登录: 2024-07-05
一、问题描述

笔者使用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解决方法,本文记录了几种可能的解决方案,并利用所提供的解决方案解决了笔者所遇到的问题

ThanksView 最后编辑, 2022-07-14 19:29:50
沙发
2025-03-30 08:26:28
pHqghUme
  • 访问次数: 2
  • 注册日期: 2025-03-30
  • 最后登录: 2025-03-30
1
板凳
2025-03-30 08:26:29
pHqghUme
  • 访问次数: 2
  • 注册日期: 2025-03-30
  • 最后登录: 2025-03-30
1
#3
2025-03-30 08:27:38
pHqghUme
  • 访问次数: 2
  • 注册日期: 2025-03-30
  • 最后登录: 2025-03-30
1
#4
2025-03-30 08:27:43
pHqghUme
  • 访问次数: 2
  • 注册日期: 2025-03-30
  • 最后登录: 2025-03-30
1
1/1

三维半岛官网: http://www.thanksview.com

进入首页