Centos6使用yum install git安装的git版本比较低,当前版本为1.7.1,我们可以自己下载新版的git源码包进行编译安装:
1. 安装编译git时需要的包
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel -y
yum install gcc perl-ExtUtils-MakeMaker -y
删除yum安装的git包(如果已经安装的话)
yum remove git
2. 下载git源码
cd /usr/local/src
下载
wget https://www.kernel.org/pub/software/scm/git/git-2.14.0.tar.gz
解压
tar zxvf git-2.14.0.tar.gz
3. 编译安装
cd git-2.14.0
./configure prefix=/usr/local/git
make && install
export PATH=$PATH:/usr/local/git/bin
安装完毕执行git –version查看版本号
[root@www git]# git –version
git version 2.14.0
原创文章,作者:3628473679,如若转载,请注明出处:https://blog.ytso.com/193679.html