282

I am unable to clone HTTPS repositories. I can clone SSH repos fine, but not HTTPS repos. I cannot test the GIT protocol since I am behind a corporate firewall.

This is what I am trying to do:

$ git clone https://github.com/nvie/gitflow.git
Cloning into gitflow...
fatal: Unable to find remote helper for 'https'

I have so far tried the following (based on Google searches)

  • Purging and installing Git through apt-get
  • Installing build-deps for Git through apt-get
  • Installing curl dev libraries
  • Installing expat libraries
  • Downloading Git source and building using:
    • ./configure --prefix=/usr --with-curl --with-expat
    • Also tried pointing configure at curl binary (./configure --prefix=/usr --with-curl=/usr/bin/curl)

I have tried everything I can find on the internet with no luck. Can anyone help me?

Git version = 1.7.6.4

OS = Ubuntu 11.04

jww
  • 97,681
  • 90
  • 411
  • 885
Ben K
  • 3,047
  • 3
  • 17
  • 17
  • Sorry to be obvious, it sounds like curl isn't installed. do `curl --help` and see if it is. – mike jones Nov 30 '11 at 19:09
  • 1
    I am getting back a list of curl options when I run curl --help. – Ben K Dec 01 '11 at 09:13
  • 1
    I know, like I mentioned at the top of my question, I've gone through every result I can find in Google. Nothing has worked so far! – Ben K Dec 01 '11 at 11:40
  • Nothing appears in syslog after I run the git clone command, sadly. – Ben K Dec 12 '11 at 09:02
  • 2
    I have the same issue. I'm behind a corporate firewall too. I tried to recompile with all the options found in Internet, but not work at all. Any other idea? –  Jan 20 '12 at 19:04
  • 1
    Funny thing is, I'm trying to clone from curl's github so that I can compile it on a locked-down $%^* Solaris box. – makhdumi Apr 14 '15 at 21:53
  • You got the same issue when you have the wrong curl PROXY setup. – kisp Sep 12 '14 at 08:48
  • I have tried everything suggested in the answers, plus a whole lot more. Since there does not seem to be a solution I am closing the question. In the end I have re-installed my PC and the problem did not re-occur. – Ben K Feb 21 '12 at 09:09
  • One more suggestion to anybody struggling with this, make sure you check your `GIT_EXEC_PATH` environment variable to make sure it isn't pointing somewhere silly. – juniper- Apr 26 '16 at 16:58
  • I had this error message because i made a typo and had "ssh:://" (notice the double : <-) – Alex2php Aug 05 '16 at 10:42
  • Maybe it'll work with ssh? – Olga Apr 24 '17 at 14:33

25 Answers25

319

It looks like not having (lib)curl-devel installed when you compile git can cause this.

If you install (lib)curl-devel, and then rebuild/install git, this should solve the problem:

$ yum install curl-devel
$ # cd to wherever the source for git is
$ cd /usr/local/src/git-1.7.9  
$ ./configure
$ make
$ make install

This worked for me on Centos 6.3.

If you don't have yum, you can download the source to curl-devel here:


If you are running Ubuntu instead:

sudo apt-get install libcurl4-openssl-dev 
Daniel Stenberg
  • 54,736
  • 17
  • 146
  • 222
TastyCode
  • 5,679
  • 4
  • 37
  • 42
  • 4
    these steps worked for me. CentOS 5.8 32 bit ;git version 1.8.0 – Vikram Dec 04 '12 at 21:10
  • Also for me, red hat linux 5. – Marco Apr 03 '13 at 09:26
  • 1
    Worked for me CentOS 6.4 and git 1.8.2.1 – JoxTraex Apr 10 '13 at 12:58
  • Which linux package to get for CentOS? the RedHat one? – Steven Lu Apr 17 '13 at 21:31
  • 18
    On Ubuntu 12.04 LTS the package I needed was: `sudo apt-get install libcurl4-openssl-dev` – Michael Burr May 30 '13 at 18:29
  • 2
    On Ubuntu 10.04 LTS the package I needed was: `sudo aptitude install libcurl4-openssl-dev` apt-get has dependency problem and aptitude seems can resolve it – wenchiching Dec 24 '13 at 12:56
  • 1
    I had this problem because I was working on git itself, and had done a "make install" into my ~/bin directory. My PATH picked up ~/bin/git which encountered the error. Using /usr/bin/git solved the problem. – qneill Apr 30 '15 at 04:38
  • Worked for me on CentOS 6.6. Thanks – Darksaint2014 Jul 09 '15 at 18:11
  • Note that it seems libcurl-devel needs to be installed on the machine you're running the binary from. I compiled git from a machine with libcurl-devel and it works, but when I move the binary to a machine without libcurl-devel it doesn't work. – apottere Sep 02 '15 at 16:10
  • Doesn't seem to work for Ubuntu VM on Azure. I've been at this for an entire day. I keep getting the 'https' error. – Clinkz Jun 01 '17 at 16:37
  • Great answer! On CentOS 7, I also run `yum` to install other libraries: `yum -y install gettext-devel openssl-devel curl-devel perl-CPAN perl-devel zlib-devel` – Celdor Jun 26 '17 at 10:50
  • centos 6.9 el6-i386. Worked like a charm – gmanousaridis Oct 03 '17 at 20:06
  • Nothing worked for me, even after 4 hours of trying different solutions. At the end, I downloaded and installed an older version of git. I am now using 1.9.5, I had to uninstall 2.9.1 – Zwakele Mgabhi Jul 29 '18 at 06:28
  • Would like to understand, what exactly is the difference with curl-devel over curl that makes this work? From behind the firewall I can set proxies such that curl can successfully fetch that Git project URL, so what are the default option differences and how to ask Git to use them. – Ed Randall Feb 19 '19 at 13:38
  • Can you guide me the package for the MAC ? – ArunRaj Jul 29 '19 at 07:27
  • I had to also restart shell in Debian. Since Git produced the same error in the old shell. – ruvim Dec 11 '19 at 14:43
  • This worked for me on CentOS7 and git 2.9.5 – Shashi Kiran Mar 30 '21 at 17:18
89

If you are trying to clone then you could use the git transport

For example: git clone git://github.com/fog/fog.git

Vaio ~/Myworks/Hero $ git clone git://github.com/fog/fog.git

Initialized empty Git repository in /home/nthillaiarasu/Myworks/Hero/fog/.git/
remote: Counting objects: 41138, done.
remote: Compressing objects: 100% (13176/13176), done.
remote: Total 41138 (delta 27218), reused 40493 (delta 26708)
Receiving objects: 100% (41138/41138), 5.22 MiB | 58 KiB/s, done.
Resolving deltas: 100% (27218/27218), done
Gray
  • 115,027
  • 24
  • 293
  • 354
Thillai Narayanan
  • 4,766
  • 5
  • 32
  • 39
  • 4
    Thanks for your advice. Unfortunately I work behind a corporate firewall that blocks the git protocol's port and they won't open it up for me. I've been downloading tarballs to bypass the issue, but I would really like to get my install of git working properly! – Ben K Dec 08 '11 at 09:01
  • 6
    As others have mentioned, git:// isn't usually ideal, but apparently if you are in a situation in which https:// simply won't work, you can use `git config --global url."git://".insteadof https://` to force `git` to always use git:// instead of https://. This can be useful if you are trying to clone with submodules (e.g. with `--recursive`). – fakedad Dec 04 '17 at 08:30
  • Perfect. I couldn't install anything on my QNAP cloud but this worked like a charm! – phrogg Sep 05 '19 at 16:46
  • As of 2022, it seems that `git clone git://github.com/something` is not supported any more, resulting in a "remote error": "The unauthenticated git protocol on port 9418 is no longer supported." – bli May 12 '22 at 12:27
70

Just in case someone encounters this on a QNAP system or any other system with OPKG as package manager:

You need to install git-http along with git. Like:

opkg install git-http
CWBudde
  • 1,783
  • 1
  • 24
  • 28
  • 5
    You saved my day! This is exactly my case. I'm using "entware" on a Xpeonology system to get more Linux software packages, and after "opkg install git", the "git clone https://" will fail with error: fatal: Unable to find remote helper for 'https'. Thank you for mentioning this "git-http" package. – zerox Jun 17 '17 at 11:55
  • Thanks I understood the problem, but didn't know what the package was that would allow git to grab http data instead of ssh data. – erichlf Dec 12 '18 at 19:54
  • unfortunately for me this didn't work. but using git:// instead of https:// as given in another answer did work for me – jantje Oct 10 '20 at 10:56
  • You saved my life as well! I'm using Synology DSM (DSM 7.0-41222 beta) and OPKG/Entware — I had absolutely no idea _why_ this didn't work straight out of the box, as it did in the past. The answer is simple: 'in the past' I was using the _official_ `git` that came with the box; a lot has been dropped during the beta, so I'm installing what I'm missing with OPKG/Entware... and thus the `git` version I'm now using is the one coming from there... which lacked HTTP support. Duh! Oh well. Thanks for pointing this out, I'd never figure it out by myself... the OPKG managers ought to put a warning! – Gwyneth Llewelyn Feb 28 '21 at 17:00
50

I used "git://" instead of "https://" and that solved the problem. My final command was:

git clone --recursive git://github.com/ceph/ceph.git
raam86
  • 6,785
  • 2
  • 31
  • 46
cecheverria
  • 641
  • 5
  • 3
27

In our case, the problem was fixed when we checked

git --exec-path

was pointing to a path that stopped to exist. (It was pointing to the path where we've compiled git and not where we copied afterwards for anyone to access it)

We did a:

export GIT_EXEC_PATH=<path_of_/libexec/git-core/>

and solved.

Pedro Reis
  • 1,587
  • 1
  • 19
  • 19
16

On CentOS 5.x, installing curl-devel fixed the problem for me.

ron
  • 161
  • 1
  • 2
  • 8
    @RyanM: This worked for me. I `yum install curl-devel` and then I `./configure`, `make`, and `make install` on my git code. Then https:// worked for me. This is on CentOS 5.8 – Brett Sep 20 '12 at 17:14
16

I had same problem and simple to resolve it.

Just uninstall git and re-install it.

#apt-get remove --purge git-svn git-core
#rm /usr/local/bin/git
#apt-get install git-svn git-core

and everything works well.

Hope this help.

thehuyvb
  • 190
  • 3
  • 12
12

I had the exact same issue and it boiled down to an unmet dependency, however, I tried the accepted answer's solution and it did not work.

What finally worked for me was installing all of the following (this is RedHat):

sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

Afterwards, I ran the other commands as specified and it worked:

./configure
make
sudo make prefix=/usr/local install

I pulled the list of dependencies directly from Git's website. Apparently I should have started there :/

Topher Fangio
  • 20,372
  • 15
  • 61
  • 94
11

If this problem occurred while tying to use github via the github commandline utility, the problem is likely due to using the snap version of gh.

If you can clone with git clone and not get this error, then the problem is with the snap version of gh.

In the end, the github docs saved the day!
https://github.com/cli/cli/blob/trunk/docs/install_linux.md

Here's the steps to save some time (debian/ubuntu/Raspberry PiOS):

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
Sam Firke
  • 21,571
  • 9
  • 87
  • 105
Martin L. Brink
  • 407
  • 4
  • 12
8

The easiest way to fix this problem is to ensure that the git-core is added to the path for your current user

If you add the following to your bash profile file in ~/.bash_profile this should normally resolve the issue

PATH=$PATH:/usr/libexec/git-core
Rohit Poudel
  • 1,793
  • 2
  • 20
  • 24
Judder
  • 133
  • 1
  • 4
5

This worked for me in Centos 6.6 to install git 2.3.1:

  1. I didn't have curl-devel installed (checking for curl_global_init in -lcurl... no). The key was to generate configure script

  2. add rpmforge for docboox2x

  3. install packages

    yum install openssl-devel zlib-devel perl-ExtUtils-MakeMaker svn tcl perl-Locale-Msgfmt gettext asciidoc xmlto docbook2x
    
  4. make symlink

    ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
    
  5. build git

    # download latest relase from https://github.com/git/git/releases
    curl -O -J -L https://github.com/git/git/archive/v2.13.0.tar.gz
    tar xf git-2.13.0.tar.gz
    cd git-2.13.0
    make configure
    ./configure --prefix=/usr
    make all doc
    make install install-doc install-html
    
rofrol
  • 14,438
  • 7
  • 79
  • 77
3

On Mac OS X 10.9 Mavericks, the solution that worked is as follows

rvm pkg install openssl
CC=/usr/local/bin/gcc-4.2 CPP=/usr/local/bin/cpp-4.2 CXX=/usr/local/bin/g++-4.2  rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr

This is to compile Ruby with OpenSSL Support. Next, uninstall all the old versions.

brew uninstall openssl
brew uninstall curl
brew uninstall git

Next, install the updated versions. The git installation is dependent on an updated version of CURL.

brew install openssl
brew install curl
brew install git
Nick Woodhams
  • 11,977
  • 10
  • 50
  • 52
  • This worked for me ... had to remove `CC=/usr/local/bin/gcc-4.2 CPP=/usr/local/bin/cpp-4.2 CXX=/usr/local/bin/g++-4.2 ` though & used higher ruby version – Amgad Jan 04 '18 at 22:23
  • On macOS 10.14 (Mojave) my simple solution was to use Anaconda I had already installed, and type `conda install git` to install a newer git version and dependency packages. – skynaut Jun 20 '19 at 17:00
2

I was having this issue when using capistrano to deploy a rails app. The problem was that my user only had a jailed shell access in cpanel. Changing it to normal shell access fixed my problem.

Metralha
  • 21
  • 1
  • How can this be fixed while keeping the user jailed? What needs to be added to `jk_init.ini` under `[git]` to fix this? – gone Dec 02 '18 at 21:37
2

For those using git with Jenkins under a windows system, you need to configure the location of git.exe under: Manage Jenkins => Global Tool Configuration => Git => Path to Git executable and fill-in the path to git.exe, for example; C:\Program Files\Git\bin\git.exe

posix99
  • 356
  • 3
  • 13
1

I had a lot of problems with this remote helper issue. I ensured that I had installed all the expat, curl etc. but finally resolved it by updating gcc after finding that version 4.4.4 was duff. Just did a yum update and recompiled with 4.4.6.

user1164594
  • 161
  • 1
  • 1
  • 6
1

On centos 7:

$ yum install curl-devel
$ yum reinstall git

That work´s for me.

Johan Morales
  • 149
  • 1
  • 7
0

I got the same problem today: git http broken after years of happy service. It seems caused by some Perl lib updates. Tried some sane suggestions on web, none worked. Had enough, I just removed all git stuff, got a new tarball from http://git-scm.com/, compiled and installed, and all things are back to normal. Give it try, or you can go dig deep into your logs...

Wen Bian
  • 11
  • 1
0

I had to add a couple of extra installs running CentOS release 5.10 (Final):

yum install openssl097a.x86_64 
yum install openssl-perl.x86_64 

Using git-1.8.5: ./configure make clean make make install

git clone https://github.com/michaelficarra/CoffeeScriptRedux.git
Cloning into 'CoffeeScriptRedux'...
remote: Reusing existing pack: 4577, done.
remote: Counting objects: 24, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 4601 (delta 13), reused 11 (delta 1)
Receiving objects: 100% (4601/4601), 2.60 MiB | 126.00 KiB/s, done.
Resolving deltas: 100% (2654/2654), done.
Checking connectivity... done.
millhouse
  • 9,817
  • 4
  • 32
  • 40
0

I landed here once because I was working with git itself. When I built it the default makefile installed the binary in ~/bin/git. Since my PATH had ~/bin first when I ran 'git pull --rebase' it used the one in ~/bin and consequently could not locate the helpers.

I worked around the issue by running '/usr/bin/git ...' with a full path (alternatively I could have adjusted my PATH).

qneill
  • 1,643
  • 14
  • 18
0

worked

1- I had to remove git:

sudo apt-get remove git

2- re - install git with the -all suffix:

sudo apt-get install git-all

as taught here: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

3- checked all settings (user name & email) of my github account

by the way I was mistaken the good email which was the source of my errors ;) https://github.com/settings/profile
check your username
https://github.com/settings/emails
check your email is the good one

4- I have followed the tutorial of git here

https://help.github.com/articles/connecting-to-github-with-ssh

marcdahan
  • 2,654
  • 25
  • 25
0

In my case nothing was successful, after a while looking what was happening I found this on my config file. Not sure how it got there

% cat ~/.gitconfig 
[user]
    email = xxxxxxx@gmail.com
    name = xxxxxx
[alias]
    g = grep -n -i --heading --break
[url "git+https://github.com/"]
    insteadOf = git@github.com:
[url "git+https://"]
    insteadOf = git://

After removing the url properties everything was working fine again

Bruno Manzo
  • 353
  • 3
  • 15
0

CentOS Minimal usually install version 1.8 git by yum install gitcommand.

The best way is to build & install it from source code. Current version is 2.18.0.

  1. Download the source code from https://mirrors.edge.kernel.org/pub/software/scm/git/ or curl -o git-2.18.0.tar.gz https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz

  2. Unzip by tar -zxf git-2.18.0.tar.gz && cd git-2.18.0

  3. Install the dependency package by executing yum install autoconf curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel asciidoc xmlto openjade perl* texinfo

  4. Install docbook2X, it's not in the rpm repository. Download and install by

    $ curl -o docbook2X-0.8.8-17.el7.x86_64.rpm http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/d/docbook2X-0.8.8-17.el7.x86_64.rpm $ rpm -Uvh docbook2X-0.8.8-17.el7.x86_64.rpm

And make a unix link name:

ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
  1. Compile and install, reference to https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

    $ make configure $ ./configure --prefix=/usr $ make all doc info $ sudo make install install-doc install-html install-info

  2. Reboot your server (If not, you may encounter Unable to find remote helper for 'https' error)

    $ reboot now

  3. Test:

    $ git clone https://github.com/volnet/v-labs.git $ cd v-labs $ touch test.txt $ git add . $ git commit -m "test git install" $ git push -u

Eric Kung
  • 43
  • 1
  • 1
  • 10
0

I got this error on Windows while using TortoiseGit. Reinstalling Git for Windows and telling TortoiseGit the path to git.exe by re-running the First Start Wizard fixed it.

Matthew
  • 1,630
  • 1
  • 14
  • 19
0

In my case git --exec-path was pointing to the correct path and git-remote-https existed but didn't have execution permission. So chmod +x git-remote-http fixed the issue.

nicolausYes
  • 633
  • 8
  • 33
0

found this in 2020 and solution solved the issue with OMZ https://stackoverflow.com/a/13018777/13222154

...
➜  ~ cd $ZSH
➜  .oh-my-zsh (master) ✗ git remote -v
origin  https://github.com/ohmyzsh/ohmyzsh.git (fetch)
origin  https://github.com/ohmyzsh/ohmyzsh.git (push)
➜  .oh-my-zsh (master) ✗ date ; omz update
Wed Sep 30 16:16:31 CDT 2020
Updating Oh My Zsh
fatal: Unable to find remote helper for 'https'
There was an error updating. Try again later?
omz::update: restarting the zsh session...

...

    ln "$execdir/git-remote-http" "$execdir/$p" 2>/dev/null || \
    ln -s "git-remote-http" "$execdir/$p" 2>/dev/null || \
    cp "$execdir/git-remote-http" "$execdir/$p" || exit; \
done && \
./check_bindir "z$bindir" "z$execdir" "$bindir/git-add"
➜  git-2.9.5 
➜  git-2.9.5 
➜  git-2.9.5 
➜  git-2.9.5 omz update       
Updating Oh My Zsh
remote: Enumerating objects: 296, done.
remote: Counting objects: 100% (296/296), done.
remote: Compressing objects: 100% (115/115), done.
remote: Total 221 (delta 146), reused 179 (delta 105), pack-reused 0
Receiving objects: 100% (221/221), 42.89 KiB | 0 bytes/s, done.
Resolving deltas: 100% (146/146), completed with 52 local objects.
From https://github.com/ohmyzsh/ohmyzsh
 * branch            master     -> FETCH_HEAD
   7deda85..f776af2  master     -> origin/master
Created autostash: 273f6e9
elulcao
  • 470
  • 4
  • 15