1. centos7安装Git:
yum -y install git
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
#这是https://git-scm.com/官网查的git最新版本
wget https://github.com/git/git/archive/v2.30.1.zip
unzip v2.30.1.zip
cd git-2.30.1
make prefix=/root/git all
make prefix=/root/git install
git --version
vim /etc/profile
最后一行加入:
#git
export PATH=/root/git/bin:$PATH
source /etc/profile
git --version
2. cnetos7移除Git:
yum remove git
-