1)卸载系统自带的低版本git(1.7.1)
#git --version
git version 1.7.1
# yum remove git
2)编译安装最新的git版本
# cd /usr/local/src/
更新地址https://www.kernel.org/pub/software/scm/git查询最新版本
# wget https://www.kernel.org/pub/software/scm/git/git-2.22.0.tar.xz
# tar -vxf git-2.22.0.tar.xz
# cd git-2.22.0
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
# source /etc/profile
更新成功
# git --version
git version 2.22.0