【www.bbyears.com--linux】
代码如下
#!/bin/sh
# Notes: Git installer For CentOS
echo -e "n==========================================================="
echo -e "nGit installer For CentOS 6.x."
echo -e "nAuthor : xiehai ~ QQ:50083000."
echo -e "n"
echo -e "===========================================================n"
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
echo -n "Your need Git"s version (like. 1.8.5.5):"
read version
echo -e "Waiting...3 seconds"
sleep 3
yum -y install gcc make curl curl-devel zlib-devel openssl-devel perl perl-devel cpio expat-devel gettext-devel
cd /usr/local/src
if [ -s git-$version.tar.gz ]; then
echo "git-$version.tar.gz [found]"
else
echo "Error: git-$version.tar.gz not found!!!download now......"
wget -c https://github.com/git/git/archive/v$version.tar.gz -O git-$version.tar.gz
fi
tar zxvf git-$version.tar.gz
cd git-$version
autoconf
./configure
make && make install
git --version
备注: git clone http://username:password@domain.com/developteam/ecstore.git