标签:git
yum升级git 服务器上的git版本太低,很多东西不能用了,要升级git版本#!/bin/bash
if [ ! -d /home/tools/ ];then
mkdir -p /home/tools
else
rm -rf /home/tools && mkdir -p /home/tools
fi
cd /home/tools
yum update -y
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
cd /home/tools
wget -c https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
if [ $? -eq 0 ];then
tar zxvf git-2.9.5.tar.gz
fi
cd git-2.9.5 && make prefix=/usr/local/git all && make prefix=/usr/local/git install
if [ $? -eq 0 ];then
rm -rf /usr/bin/git
ln -s /usr/local/git/bin/git /usr/bin/git
else
exit 1
fi
git --version
标签:git
原文地址:http://blog.51cto.com/jinyan2049/2084926