安装环境准备
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker
curl是将http请求封装的相当好的库;
expat是一款比肩ibxml、minixml的解析库;
gettext是帮助程序员和翻译人员开发多语言程序包的一套函数库;
openssl是一套http文件加密相关库;
zlib是个强大开源无损的数据压缩库;
gcc是传统的C语言编译器;
perl-ExtUtils-MakeMaker为也不清楚这是啥,安装好多软件尤其是pear相关的,没有它都会报错
编译git遇到的perl-ExtUtils-MakeMaker错误 : https://blog.csdn.net/zj_jim/article/details/55190192
软件准备
wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz
tar zvf git-2.9.5.tar.xz
安装并配置
旧版本卸载
# git --version && yum remove git
配置并安装
# cd git-2.9.5
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
添加环境变量
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
# source /etc/bashrc //最好reboot