fatal: unable to find remote helper for ‘https‘

本文介绍了如何解决在使用git clone时遇到的HTTPS远程助手缺失问题,包括修改配置、使用SSH链接以及安装git-http。步骤包括编辑~/.profile添加路径并生效,以及针对不同情况尝试git clone --recursive git@gitee.com的命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题 

git clone ​​​​​​https://gitee.com/<username>/<project>.git

上面 git clone 使用 https 的项目链接时,可能会报如下错误。

fatal: unable to find remote helper for 'https'

解决办法

修改配置

编辑 /etc/profile 文件,在末尾添加下行: 

export PATH=${PATH}:/usr/libexec/git-core

source /etc/profile 让文件立即生效或者重启一下机器:

source /etc/profile

再次执行克隆命令即可正常克隆项目了。

使用 ssh 链接

使用 git@gitee.com 的链接克隆

git clone --recursive git@gitee.com:<username>/<project>.git

安装 git-http

网上也有答案说使用 yum install git-http

但是有些机器上似乎行不通(比如 centos7,尽管我已经安装过了 epel-release):

[root@master ~]# yum install git-http
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                            | 6.8 kB  00:00:00     
 * base: mirrors.aliyun.com
 * epel: mirror.lzu.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                            | 3.6 kB  00:00:00     
crystal                                                                                                         | 2.9 kB  00:00:00     
docker-ce-stable                                                                                                | 3.5 kB  00:00:00     
epel                                                                                                            | 4.7 kB  00:00:00     
extras                                                                                                          | 2.9 kB  00:00:00     
jenkins                                                                                                         | 2.9 kB  00:00:00     
updates                                                                                                         | 2.9 kB  00:00:00     
(1/2): epel/x86_64/updateinfo                                                                                   | 1.0 MB  00:00:00     
(2/2): epel/x86_64/primary_db                                                                                   | 7.0 MB  00:00:01     
No package git-http available.
Error: Nothing to do

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值