yum remove git*
wget https://www.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz
tar -zxvf git-2.18.0.tar.gz
cd git-2.18.0
(先安装这个,否则执行git clone https://..会报错)
yum install curl-devel
./configure --prefix=/usr/local/git-2.18.0
make
make install
报错
(1)zlib错误
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
(2) expat.h
yum install expat-devel
(3)
yum install perl-ExtUtils-MakeMaker
(4) openssl/ssl.h
yum install openssl-devel
ln -s /usr/local/git-2.18.0/bin/* /usr/bin/
git --version
export PATH=/usr/local/git-2.18.0/bin:$PATH
source /etc/profile