安装依赖库
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc-c++ perl-ExtUtils-MakeMaker
查看git版本信息
git --version
移除默认的git
yum remove git
最新git源码下载
wget https://github.com/git/git/archive/v2.3.0.zip
解压
unzip v2.3.0.zip
进入目录,进行安装
make prefix=/root/git all
make prefix=/root/git install
修改环境变量
vim /etc/profile
# 在文件的最后一行加上git的路径
export PATH=/root/git/bin:$PATH
使用文件生效
source /etc/profile
检查版本
git --version