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