问题说明:
Git编译没有难度,只是编译安装后无法使用http,https协议,下载代码报错,git clone http或https的操作就报“fatal: Unable to find remote helper for ‘http’”,网上查了很多方法验证都不行,最后是先编译curl,再编译git解决的,具体编译步骤说明如下:
编译Curl方法:
优先编译curl,代码下载地址:
https://curl.se/download.html
编译配置方法:
./configure --prefix=/usr/local/
–disable-static
–with-openssl
–enable-threaded-resolver
–with-ca-path=/etc/ssl/certs
make 编译
安装方法:
make install &&
rm -rf docs/examples/.deps &&
find docs ( -name Makefile* -o -name *.1 -o -name *.3 ) -exec rm {} ; &&install -v -d -m755 /usr/share/doc/curl-7.78.0 &&
cp -v -R docs/* /usr/share/doc/curl-7.78.0
编译Git方法:
优先编译curl,代码下载地址:
https://mirrors.edge.kernel.org/pub/software/scm/git/
编译配置方法:
./configure --prefix=/usr/local --with-curl --with-expat
make
make install
如果以上安装完还是无法使用,通过git --exec-path、whitc curl查看路径,再修改/etc/profile增加内容如下: