If it exists, delete the original version:
yum remove git
Install the git environment:
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
Download the Linux version of git from the official website:
Address: https://mirrors.edge.kernel.org/pub/software/scm/git/ Extract : tar -xzvf git - 2.17.0.tar.gz cd git - 2.17.0 configure: ./configure prefix = /usr/local/git/ compile install: make && make install
Add environment variables: /etc/profile:
# set for git export GIT_HOME=/usr/local/git export PATH=$GIT_HOME/bin:$PATH
View version:
source /etc/profile
git --version