CentOS6.7安裝最新git

來源:互聯網
上載者:User

CentOS6.7安裝最新git
1. 安裝編譯環境

# yum -y install gcc zlib-devel openssl-devel perl cpio expat-devel gettext-devel curl perl-ExtUtils-MakeMaker asciidoc xmlto
2. 下載git最新壓縮包

Git最新壓縮包:http://codemonkey.org.uk/projects/git-snapshots/git/

執行以下命令下載git最新壓縮包:

# wget -c http://codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.xz
3. 解壓git壓縮包
# xz -d git-latest.tar.xz# tar -xvf git-latest.tar
4. 編譯安裝git
# cd git-2016-05-24# autoconf# ./configure# make && make install(或make -jn && make -jn install)

其中make -jn中的n為指定線程數,對於多核處理器這樣可以加快編譯安裝的速度

5. 建立git軟連結
# ln -s /usr/local/bin/git /usr/bin/

由於原版centos內建git, 故/usr/bin/git已存在, 將其刪除, 重新建立, 如下:

# rm -fr /usr/bin/git# ln -s /usr/local/bin/git /usr/bin/
6. 檢查版本號碼
# git --versiongit version 2.9.0-rc0

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.