2

I'm working on a CentOS 7.9 GNU/Linux system. I've built and installed a newer version of git (2.34.1 instead of 1.8.3.1 that's bundled with the distribution) under /opt/git/2.34.1, with a symlink to that directory at /opt/git/current; and I've added that symlinked directory to (the beginning of) my $PATH variable.

Unfortunately, when I try the checkout a repository with an HTTPS URL, I get a few errors

$ git clone https://github.com/eyalroz/cuda-api-wrappers.git
Cloning into 'cuda-api-wrappers'...
git: 'remote-https' is not a git command. See 'git --help'.

cloning with the old version of git - works.

Why does this happen, and what can I do to resolve it?

einpoklum
  • 8,772
  • 19
  • 65
  • 129
  • “It's under `/opt/git/current`” but the error message references `/opt/git/share`. There's something wrong with the installation: a path mismatch somewhere. If you need help with that, post the exact method you used to install. – Gilles 'SO- stop being evil' Mar 15 '22 at 14:38
  • @Gilles'SO-stopbeingevil': I built from source, and I _think_ I `/.configure`d it with `--prefix=/opt/git`, but then moved it into `/opt/git/2.3.41` manually with `/opt/git/current` pointing there. Maybe I should reinstall. – einpoklum Mar 15 '22 at 14:50
  • @Gilles'SO-stopbeingevil': Ok, so, that seems to have gotten rid of the "warning templates not found", but only that. So, editing the question. – einpoklum Mar 15 '22 at 14:54

1 Answers1

5

Git uses libcurl library to push/fetch repositories via http:// and https://. This error occurs if you compile git without the library present.

Install it (yum/dnf install libcurl-devel) and then reconfigure and recompile git. It should work.

Link: https://github.com/git/git/blob/b896f729e240d250cf56899e6a0073f6aa469f5d/INSTALL#L141-L149

Mickan
  • 66
  • 1