centos6.5 安装git 最新版本

#安装git需要的库
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker

#删除自带的git
yum remove git

#切换到目录
cd /usr/src

#可以去看看需要的版本号
https://www.kernel.org/pub/software/scm/git/

#这里选择下载git2.7.0版本
wget https://www.kernel.org/pub/software/scm/git/git-2.7.0.tar.gz

#解压缩
tar -zxvf git-2.7.0.tar.gz

#切换到git-2.7.0目录
cd git-2.7.0

#开始验证
./configure

#编译安装
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo “export PATH=$PATH:/usr/local/git/bin” >> /etc/bashrc
source /etc/bashrc

#查看版本号
git –version

发表评论