-
查看旧git版本 git --version
git version 1.8.3.1
-
卸载git
yum remove git
-
安装git编译需要的包
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
yum install gcc perl-ExtUtils-MakeMaker -
https://mirrors.edge.kernel.org/pub/software/scm/git/ 地址找最新的版本 这里选择git-2.9.5.tar.xz版本
cd /usr/local/src/
wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz -
解压
tar -vxf git-2.9.5.tar.xz
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/profile -
查看版本 git --version
git version 2.9.5
centos git 升级
猜你喜欢
转载自blog.csdn.net/liuxiaoming1109/article/details/82993924
今日推荐
周排行