linux install git

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

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324757841&siteId=291194637