运维开发网

CentOS/RHEL 7/6 安装最新Git

运维开发网 https://www.qedev.com 2020-03-09 16:28 出处:网络 作者:运维开发网整理
安装依赖包 本文环境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

安装依赖包

本文环境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版本

0

精彩评论

暂无评论...
验证码 换一张
取 消