1、下载高版本的git,地址:https://github.com/git/git/release,选择git-2.9.3.tar.gz
2、安装依赖包、解压、编译安装
- yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl perl-devel
- tar -xf git-2.9.3.tar.gz
- cd git-2.9.3
- make prefix=/usr/local all
- make prefix=/usr/local install
3、配置环境变量
- echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
- source /etc/bashrc