CentOS/RHEL 7/6 安装最新Git

前端之家收集整理的这篇文章主要介绍了CentOS/RHEL 7/6 安装最新Git前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

安装依赖包

本文环境CentOS 6.8 ,默认安装git为1.7.1,实验需要升级git版本

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker -y

卸载旧git

yum remove git -y

下载Git源代码并编译安装

Git source download:https://www.kernel.org/pub/software/scm/git/

wget https://www.kernel.org/pub/software/scm/git/git-2.11.0.tar.gz -P /usr/local/src # 下载git

cd /usr/local/src && tar zxvf git-2.11.0.tar.gz && cd git-2.11.0 

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版本

原文链接:https://www.f2er.com/centos/379443.html

猜你在找的CentOS相关文章