1. Install git dependencies
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
2. Delete the existing git
yum remove git
3. Download the git source code
①. Switch to your package file storage directory, mine is /data/github
②Download the git installation package wget https://www.kernel.org/pub/software/scm/git/git-2.9.4.tar.gz
③ Unzip and install tar -zxvf git-2.9.4.tar.gz
④ After installation, enter the directory to configure the git installation path (if you want the default path, you can skip this step, just compile and install directly), compile and install
cd
./configure prefix=/usr/local/git/
make && make install
The installation is complete,
⑤, add the git command to the bash
vi /etc/profile
add in the last line
export PATH=$PATH:/data/services/git/bin
Make the configuration file take effect immediately
source /etc/profile
Installed!