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