CentOS6 安装git

1.Install dependencies:
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel gcc perl-ExtUtils-MakeMaker

2.Install MakeMaker
cd /usr/local/src
wget http://files.directadmin.com/services/9.0/ExtUtils-MakeMaker-6.31.tar.gz
tar xvzf ExtUtils-MakeMaker-6.31.tar.gz
cd ExtUtils-MakeMaker-6.31
perl Makefile.PL
make
make install

3.Download and compile the latest git source:
cd /usr/local/src
wget http://git-core.googlecode.com/files/git-1.7.9.2.tar.gz
tar xvzf git-1.7.9.tar.gz
cd git-1.7.9.2
./configure
make
make install

4.Test installation by initializing a new git repository
cd ~/
mkdir test.git
cd test.git
git init

你可能感兴趣的:(centos6)