0)安装依赖软件
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
yum install gcc perl-ExtUtils-MakeMaker
1)卸载系统自带的Git版本git(1.7.1)
git --version
git version 1.7.1
yum remove git
2)编译安装最新的git版本
cd /usr/local/src/
wget https://www.kernel.org/pub/software/scm/git/git-2.24.0.tar.xz
tar -vxf git-2.24.0.tar.xz
cd git-2.24.0
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo “export PATH=$PATH:/usr/local/git/bin” >> /etc/profile
source /etc/profile
git --version
git version 2.24.0