標籤:
系統內容:centos6.6
1,安裝準備
yum -y install gcc zlib-devel openssl-devel perl cpio expat-devel gettext-devel openssl zlib curl autoconf tk
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install perl-ExtUtils-MakeMaker packageyum install gettext-develyum install asciidocyum install xmlto
下載最新git: #cd /opt/下
#wget https://www.kernel.org/pub/software/scm/git/git-2.7.0.tar.gz (或者從官網 http://git-scm.com/download ;http://git-core.googlecode.com/files)
#tar zxvf git-2.7.0.tar.gz
#cd git-2.7.0
#make prefix=/opt/git all doc 安裝在/opt/git目錄
#make prefix=/opt/git install install-doc
#./configure --prefix=/opt/git
#make
#make install
#/opt/git/bin/git --version
git version 2.7.0
為了方便使用,做一個軟連結
#ln -s /opt/git/bin/* /usr/bin/
即安裝成功
========================================
方法二 安裝目錄在/usr/local
=================================================極速安裝git最新版(update ):$ git clone git://git.kernel.org/pub/scm/git/git.git$ make prefix=/usr/local all (編譯)$ sudo make prefix=/usr/local install (安裝)=================================================
centos 6.6編譯安裝git-2.7.0 最新git編譯安裝