centos6.2 编译安装git 脚本

yum 安装git会将服务器已经升级的openssh从5.8.P2覆盖为5.3.P1,所以决定源码编译安装。简单整理编译安装脚本如下:


#!/bin/bash


yum install perl-Time-HiRes curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel perl-ExtUtils-MakeMaker package -y

#下载最新的git包


cd /workspace

wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz

tar xzvf git-latest.tar.gz

cd git-$(date +%Y-%m-%d)

autoconf

./configure

make && make install


#检查下安装的版本,大功告成

ln -s /usr/local/bin/git /usr/bin/


git --version


你可能感兴趣的:(centos,编译安装)