CentOS 6.5 mini 安裝Git-core

來源:互聯網
上載者:User

在使用CentOS yum 源裡面git 同步GoogleAndroid 源碼時,發現版本太低。無法從google 伺服器同步代碼。下面就是關於在Centos 6.5 mini 版中安裝git 最新版本。


一、伺服器安裝
CentOS 6.5 mini 化安裝最小作業系統,並對系統軟體進行升級
#yum update


二、安裝開發軟體包等軟體
#yum  -y install vim openssh-clients setuptoolntsysv system-config-securitylevel-tui system-config-network-tui wget man gccgcc-c++ gcc-g77 flex autoconfig automake bison zlib-devel bzip2-develncurses-devel libtool libtool-ltdl openssl openssl-devel pam-devellibtermcap-devel curl-devel libxml2-devel libevent libevent-devel gettext-develexpat-devel

三、到官網去下載git 源碼、並解壓
#Wget https://git-core.googlecode.com/files/git-1.8.5.tar.gz
#tar zxvf git-1.8.5.tar.gz

四、安裝git
安裝方法寫在INSTALL檔案中,參照其中的指示即可完成安裝。INSTALL 文檔預設安裝路徑在/usr/下,這裡我們安裝到/usr/local 裡。下面的命令將 Git 安裝在/usr/local/bin中。(非完整安裝)
# cd git-1.8.5
# make prefix=/usr/local all
# make prefix=/usr/local install

五、安裝Git 文檔(可選)
編譯的文檔主要是 HTML格式的文檔,方便通過git help -w <sub-command> 命令查看。實際上,即使不安裝 Git 文檔,也可以使用 man 手冊查看 Git 協助,使用命令githelp <sub-command>或git <sub-command> --help即可。
編譯文檔依賴asciidoc,因此需要先安裝 asciidoc(如果尚未安裝的話),然後編譯文檔。在編譯文檔時要花費很多時間,要有耐心。
                # yum -y install asciidoc
                # make prefix=/usr/local all doc info
                  #make prefix=/usr/local install-doc install-html install-info

註:安裝文檔時候會出現一下錯誤
錯誤一:
/bin/sh: line 1: xmlto: command not found
make[1]: *** [git-add.1] Error 127
make[1]: Leaving directory `/home/soft/git-1.8.5/Documentation'
make: *** [doc] Error 2
解決:
安裝xmlto
#yum –y insgtall xmlto
錯誤二:
/bin/sh: line 1: docbook2x-texi: commandnot found
make[1]: *** [user-manual.texi] Error 127
make[1]: Leaving directory`/home/soft/git-1.8.5/Documentation'
make: *** [info] Error 2
這是因為git完整安裝需要asciidoc,docbook2X,運行命令
# yum -y install texinfo
# rpm -ivh http://mirror.1000mbps.com/Fedora-epel/6Server/x86_64/docbook2X-0.8.8-1.el6.x86_64.rpm
#cd /usr/bin
# ln -s db2x_docbook2texi docbook2x-texi

附:安裝git命令補齊功能
# rpm –ivh http://mirror.1000mbps.com/fedora-epel/6Server/x86_64/bash-completion-1.3-7.el6.noarch.rpm
# cp  contrib/completion/git-completion.bash /etc/bash_completion.d/
# source /etc/bash_completion

Git 的詳細介紹:請點這裡
Git 的:請點這裡

推薦閱讀:

Fedora通過Http Proxy下載Git

在Ubuntu Server上安裝Git

伺服器端Git倉庫的建立(Ubuntu)

Linux下Git簡單使用教程(以Android為例)

Git權威指南 PDF高清中文版

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.