Install the latest version of GIT (CentOS) from the source code


Used in CentOSyum install gitInstalling Git is often not a new version. At this time, we can choose to download the latest version of GIT source code from the official website to compile and install

Download source code


Installation dependency

yum install curl-devel

If curl devel is not installed in the system, the following error will be reported if you use HTTPS protocol to clone code after compiling and installing later
fatal: Unable to find remote helper for 'https'

Unzip and compile the installation

tar -zxvf git-2.17.0.tar.gz
cd git-2.17.0
./configure --prefix=/usr/local/git
make install

Setting environment variables

echo 'PATH=$PATH:/usr/local/git:/usr/local/git/libexec/git-core' > /etc/profile.d/


git version

outputgit version 2.17.0Indicates that the installation was successful

Recommended Today

Heavyweight Tencent cloud open source industry’s first etcd one-stop governance platform kstone

​ Kstone open source At the kubecon China Conference held by CNCF cloud native foundation on December 9, 2021,Tencent cloud container tke team released the open source project of kstone etcd governance platform. KstoneIt was initiated by the TKE team of Tencent cloud containerCloud native one-stop etcd governance project based on kubernetes。 The project originates […]