查看当前git版本
# git --version
安装
1、卸载CentOS自带的git低版本
# yum remove git
2、安装依赖项
# yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
# yum install -y gcc perl-ExtUtils-MakeMaker
3、下载最新的git版本
# cd /home/temp
# wget wget https://www.kernel.org/pub/software/scm/git/git-2.19.1.tar.xz
4、解压、编译、安装
# tar -vxf git-2.19.1.tar.xz
# cd git-2.19.1
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
5、配置路径
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
6、验证git版本
# git --version