git源码编译

–查看已安装的软件版本
rpm -qa | grep mysql

–删除已安装git
yum remove git

–git版本包列表
https://www.kernel.org/pub/software/scm/git/
–下载
wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz

yum install -y gcc gcc-c++
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install -y perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

tar zxvf git-2.9.5.tar.gz
cd git-2.9.5/
make prefix=/usr/local all
sudo make prefix=/usr/local install

添加环境
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

查看版本
git  --version

参考:
https://git-scm.com/book/zh/v1/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git