虚拟机上由于网络问题无法正常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 小时前
23_实验二十二_移植网卡驱动
linux
数商思语行2 小时前
从BA、产品、实施或开发转做FDE,先补哪种能力
人工智能·ai·供应链·商业分析·ontology·本体·fde
水饺编程2 小时前
第1章:开发环境搭建,在 Windows 中安装 Git
linux·c语言·汇编·git·ubuntu
代码简单说2 小时前
GPT Image 2.5 API 调用教程:Node.js 实现图片生成与编辑
人工智能
迪康coolmu2 小时前
屏幕水印与防拍照落地:从水印类型到泄密溯源的完整配置
运维·网络·安全·网络安全·数据安全
0+1112 小时前
Linux --进程间关系和守护进程
linux·运维·服务器
idanzk2 小时前
Git 推送 GitHub 报 SSL_READ /src refspec main 不匹配 完整踩坑记录
git·github·ssl
零基础1232 小时前
VoiceStudio 开源项目深度解析:特性、对比与实战测试
人工智能·经验分享·python·开源
AIgorithmGEEK2 小时前
[Linux]HTTP 应用层协议全解(下篇)
linux·网络·网络协议·http·cookie·无连接·无状态
故七月3 小时前
本地生活 GEO 内容质量风控体系构建 —— 基于陕西金贝儿母婴家政项目,万域智瞰 GEO 实践
人工智能·生活