1.查看已有git版本 git --version
2.卸载git yum remove git
3.依赖库安装
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker
4.wget获取最新版git wget https://github.com/git/git/archive/v2.9.2.tar.gz
5.解压 tar -zxvf git-2.9.2.tar.gz /usr/local/git
6.开始安装git
cd /usr/local/git
make prefix=/usr/local/git all
make prefix=/usr/local/git install
7修改环境变量 echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
8使配置文件生效 source /etc/bashrc
9查看git版本号 git --version
ok,到这里就已经安装成功了.