yum remove git
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
wget https://www.kernel.org/pub/software/scm/git/git-2.31.1.tar.gz
tar -zxvf git-2.31.1.tar.gz
cd git-2.31.1
chmod u+x ./configure
./configure prefix=/usr/local/git/
make && make install
vim /etc/profile
追加:
export PATH=$PATH:/usr/local/git/bin
source /etc/profile
git --version
centos7 yum安装git版本太低,安装最新版本git
最新推荐文章于 2025-02-19 00:01:18 发布