centOS7.6安装git

# centOS7.6下安装git

yum remove git       # 删除centOS7自带git版本

cd /
wget https://www.kernel.org/pub/software/scm/git/git-2.13.3.tar.gz      # 下载git-2.13.3
tar -zxvf git-2.13.3.tar.gz       # 解压
cd git-2.13.3

# 安装依赖包
yum -y groupinstall "Development Tools"
yum -y install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel

./configure --prefix=/usr/local/git2    # 配置安装路径
make
make install

cd /usr/bin && rm -rf git          # 删除旧软链接
ln -s /usr/local/git2/bin/git /usr/bin/git     # 添加新软链接


cd / && git --version    # 安装完成,查看当前git版本

 

posted @ 2019-05-21 17:10  cooper_wang  阅读(1575)  评论(0编辑  收藏  举报