I am trying to install git from source on a server running CentOS Linux 7.7.1908 that I do NOT have root permissions on.
I have used Conda before to install Git and some other tools because it doesn't require root access, but it is not a clean solution and I have to deactivate the environment several times for using certain programs. So I am trying to install things from source to my ~/.local tree as a learning exercise and for convenience.
After installing from source to my user directory, I can use the git executable to clone SSH remotes but not HTTPS. Here is an example of the problem:
$ git clone https://github.com/test/test.git ~/tmp/test_repo
Cloning into '/home/group/user/tmp/test_repo'...
git: 'remote-https' is not a git command. See 'git --help'.
The problem seems to be caused by the Git build system not recognizing curl/libcurl on my system.
The solution for most people is to use a package manager to install libcurl-devel, or similar. I cannot do this.
I do have curl installed, whatever came with this build of CentOS I assume:
$ curl -V
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.44 zlib/1.2.7 libidn/1.28 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets
I also have tried installing openSSL and curl from source in my user directory, but I get the same results after trying to build Git:
$ curl -V
curl 7.85.0 (x86_64-pc-linux-gnu) libcurl/7.85.0 OpenSSL/1.1.1q zlib/1.2.7
Release-Date: 2022-08-31
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets
My Git installation steps are as follows:
$ make configure
$ ./configure --prefix=$HOME/tmp/git_test
$ make all -j
$ make install
After running the newly generated binary, I get the same results:
$ ./bin/git clone https://github.com/test/test.git ~/tmp/clone_test
Cloning into '/home/user/tmp/clone_test'...
git: 'remote-https' is not a git command. See 'git --help'.
I assume the problem is related to my libcurl installation, but I just don't know where the connection is messed up!
EDIT: I tried installing libcurl-devel by extracting an RPM binary package. Now I have the following directory structure:
├── bin
│ └── curl-config
├── include
│ └── curl
│ ├── curlbuild-64.h
│ ├── curlbuild.h
│ ├── curl.h
│ ├── curlrules.h
│ ├── curlver.h
│ ├── easy.h
│ ├── mprintf.h
│ ├── multi.h
│ ├── stdcheaders.h
│ └── typecheck-gcc.h
├── lib64
│ ├── libcurl.so -> libcurl.so.4.3.0
│ ├── libcurl.so.4 -> libcurl.so.4.3.0
│ ├── libcurl.so.4.3.0
│ └── pkgconfig
│ └── libcurl.pc
└── share
├── aclocal
│ └── libcurl.m4
├── doc
│ └── libcurl-devel-7.29.0
└── man
├── man1
└── man3
To solve my problem, I need to know the mechanism in which Git's configure/make tools detect if a system has libcurl installed.