Install Git on CentOS7

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
install dependent libraries
Press Y to confirm

yum install gcc perl-ExtUtils-MakeMaker
install dependent libraries
Press Y to confirm

cd /usr/local
to enter the /usr/local directory

mkdir git
create git directory
cd git
enter git directory

wget https://github.com/git/git/archive/v2.10.5.tar.gz
download git

tar -xzvf v2.10.5.tar.gz
decompress

cd git-2.10.5
into the git-2.10.5 directory

make prefix=/usr/local/git all
make prefix=/usr/local/git install
compile and install git

vim /etc/profile
configure environment variables
to add
export PATH="/usr/local/git/bin:$PATH" at the end

source /etc/profile
to make the configuration take effect

git --version
View git version

 

Guess you like

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