git 地址:
https://www.kernel.org/pub/software/scm/git/
1. 先安装一堆依赖
yum install curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel perl-ExtUtils-MakeMaker
2. 下载最新的git
先切换到下载目录。我习惯下载到src目录
cd /usr/local/src
wget https://www.kernel.org/pub/software/scm/git/git-2.4.0.tar.gz
3. 解压
tar -xvzf git-2.4.0.tar.gz
4. 编译 安装
cdgit-2.4.0
./configure && make && make install
最后 git --version 查看版本
原文链接:https://www.f2er.com/centos/381910.html