[record] centos7 6 compile and install the latest version of GIT

Time:2022-1-3

preface

Centos7.6Installed by defaultGit1.8.xedition

uninstall

$ yum remove git

Installation process

Installation dependency

$ yum -y install zlib-devel curl-devel openssl-devel perl cpio expat-devel gettext-devel openssl zlib autoconf tk perl-ExtUtils-MakeMaker

GitWarehouse download source package

$ wget https://github.com/git/git/archive/v2.22.0.tar.gz

decompression

$ tar zxvf v2.22.0.tar.gz

compile

$ cd git-2.22.0
$ autoconf
$ ./configure
$ make
$ make install

modify/etc/ld.so.conf

#Add a new row
/usr/local/lib

modify/etc/profile

#Add a new row
export PATH=$PATH:/usr/local/bin

Immediate effect

$ source /etc/profile

verification

$ git --version

This work adoptsCC agreement, reprint must indicate the author and the link to this article