删除低版本的yum安装的git
yum remove git
del success;
wget https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz
tar -zxvf git-2.8.3.tar.gz
cd git-2.8.3
./configure prefix=/usr/local/git/
make && make install
出现致命错误。原因是没有安装zlib包
安装zlib包并不是apt-get install zlib
而是用
apt-get install zlib1g-dev
fedora or redhat:
yum install zlib-devel
一般安装后可以重新编译可解决。
这里是redhat,所以使用yum install zlib-devel。安装完成后,重新执行:make && make install
又出现新的错误:
需要安装:
yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
vi /etc/profile
export PATH=$PATH:/usr/local/git/bin
source /etc/profile
当git出现clone https的错误时候说明没有安装curl-devel
需要yum install curl-devel
然后到git目录就重新安装一遍