# yum -y install gcc zlib-devel openssl-devel perl cpio expat-devel gettext-devel curl perl-ExtUtils-MakeMaker asciidoc xmlto
Git最新壓縮包下載地址:http://codemonkey.org.uk/projects/git-snapshots/git/
執行以下命令下載git最新壓縮包:
# wget -c http://codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.xz
# xz -d git-latest.tar.xz# tar -xvf git-latest.tar
# cd git-2016-05-24# autoconf# ./configure# make && make install(或make -jn && make -jn install)
其中make -jn中的n為指定線程數,對於多核處理器這樣可以加快編譯安裝的速度
# 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/
# git --versiongit version 2.9.0-rc0
http://xxxxxx/Linuxjc/1134326.html TechArticle