1.安装git编译需要的包
sudo yum groupinstall "Development Tools"
sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
2.下载&安装 git
# cd /usr/src
# wget https://www.kernel.org/pub/software/scm/git/git-2.7.3.tar.gz(git版本,本文章以2.7.3为准)
# tar xzf git-2.7.3.tar.gz
# cd git-2.7.3
# make configure
# ./configure --prefix=/usr/local
# make install
3、检查版本
# git --version