You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行repo sync遇‘unable to find remote helper for https’错误求助

解决Git缺少git-remote-http/https导致的"unable to find remote helper for 'https'"问题

问题原因

编译Git时未安装curl开发依赖库,导致configure过程跳过了HTTP/HTTPS远程助手的编译,最终git执行路径下缺失git-remote-http和git-remote-https文件。另外你之前的编译步骤存在版本不一致问题:下载的是v2.17.1的tar包,但解压的是2.22.0的包,这也可能引发异常。

解决步骤

1. 安装curl开发依赖

根据你的Linux发行版选择对应命令:

  • Debian/Ubuntu 系列:
    sudo apt-get update && sudo apt-get install libcurl4-openssl-dev
    
  • CentOS/RHEL 系列:
    sudo yum install libcurl-devel
    

2. 重新编译并安装Git(修正版本不一致问题)

# 清理之前的编译残留
rm -rf git-2.17.1 git-2.17.1.tar.gz

# 重新下载对应版本源码包
wget https://github.com/git/git/archive/v2.17.1.tar.gz -O git-2.17.1.tar.gz
tar -zxf git-2.17.1.tar.gz
cd git-2.17.1

# 重新生成配置并编译安装
make configure
./configure --prefix=/usr/local
make -j$(nproc)
sudo make install

3. 验证远程助手文件是否生成

执行以下命令检查:

ls $(git --exec-path) | grep git-remote-http

若输出包含git-remote-http和git-remote-https,说明编译成功。

4. 重新执行repo sync

现在可以再次尝试repo sync,即可正常拉取代码。

内容的提问来源于stack exchange,提问作者chi.ho

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 02:35:35