tar -zxvf git-2.42.0.tar.gz
yum install zlib
yum install zlib-devel
cd /home/git/git-2.42.0
./configure --prefix=/usr/local/git --with-iconv --with-curl --with-expat=/usr/local/lib
make && make install
vi /etc/profile
export GIT_HOME=/usr/local/git
export PATH=$PATH:$GIT_HOME/bin
保存后执行该命令让配置生效
source /etc/profile
git --version