虚拟机上由于网络问题无法正常git clone

命令:

复制代码
git clone https://github.com/IFL-CAMP/easy_handeye.git
#​(https://github.com/IFL-CAMP/easy_handeye.git 是官方的easy_handeye,手眼标定包,支持ROS Melodic)。

​

报错"gnutls_handshake() failed: Error in the pull function"

这是经典的网络连接问题

问题原因:你的系统Git使用GnuTLS库进行HTTPS连接,在某些网络环境(尤其是中国大陆)下与GitHub的TLS握手失败。

解决方案(从简单到彻底,按顺序试)

1. 最简单:用GitHub镜像克隆(推荐,零配置)

用国内镜像(如ghproxy.com或github.com.cnpmjs.org)绕过直接连接:

复制代码
git clone https://ghproxy.com/https://github.com/IFL-CAMP/easy_handeye.git

复制代码
git clone https://github.com.cnpmjs.org/IFL-CAMP/easy_handeye.git
  • 成功后,仓库就在 ~/catkin_ws/src/easy_handeye。

  • 然后编译:

    复制代码
    cd ~/catkin_ws
    catkin_make
    source devel/setup.bash
2. 如果你有代理/VPN(之前用过的)

配置Git全局代理(假设SOCKS5代理端口1080):

复制代码
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080

然后直接克隆原命令:

复制代码
git clone https://github.com/IFL-CAMP/easy_handeye.git

用完取消:

复制代码
git config --global --unset http.proxy
git config --global --unset https.proxy
3. 切换到SSH克隆(永久解决HTTPS问题)
  • 生成SSH密钥(如果没有):

    复制代码
    ssh-keygen -t ed25519 -C "your_email@example.com"
  • 复制公钥:

    复制代码
    cat ~/.ssh/id_ed25519.pub
  • 去GitHub设置 → SSH and GPG keys → New SSH key,粘贴公钥。

  • 测试:

    复制代码
    ssh -T git@github.com

    (看到"Hi username!"就成功)

  • 克隆:

    复制代码
    git clone git@github.com:IFL-CAMP/easy_handeye.git
4. 如果以上都不行(极端情况)

手动下载ZIP:

相关推荐
会员果汁2 分钟前
网络工程-路由策略概述
网络
_下雨天.4 小时前
LVS负载均衡
服务器·负载均衡·lvs
小成202303202656 小时前
Linux高级02
linux·开发语言
HIT_Weston6 小时前
45、【Agent】【OpenCode】本地代理分析(请求&接收回调)
人工智能·agent·opencode
mounter6256 小时前
【硬核前沿】CXL 深度解析:重塑数据中心架构的“高速公路”,Linux 内核如何应对挑战?-- CXL 协议详解与 LSF/MM 最新动态
linux·服务器·网络·架构·kernel
++==6 小时前
Linux 进程间通信与线程同步技术详解:IPC 机制、线程 API、同步工具与经典同步问题
linux
逻辑君6 小时前
认知神经科学研究报告【20260010】
人工智能·深度学习·神经网络·机器学习
特长腿特长7 小时前
centos、ubantu系列机的用户和用户组的结构是什么?具体怎么配置?用户组权限怎么使用?这篇文章持续更新,帮助你复习linux的基础知识
linux·运维·centos
星河耀银海7 小时前
远控体验分享:安全与实用性参考
人工智能·安全·微服务
zzzyyy5387 小时前
Linux环境变量
linux·运维·服务器