1.下载git安装包并解压
cd /lnmp/src
wget https://www.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz
tar -zxvf git-2.21.0.tar.gz
2.编译安装
./configure --prefix=/usr/local/git
make && make install
export PATH="/usr/local/git/bin:$PATH"
source /etc/profile
git --version
删除原来的git
yum remove git -y
source /etc/profile