git 源代码下载和安装(CentOS)

1.阅读INSTALL文件

$ make configure ;# as yourself
$ ./configure --prefix=/usr ;# as yourself
$ make all doc ;# as yourself
# make install install-doc install-html;# as root

2.执行 make configure

3.执行 ./configure --prefix=/usr

4.执行 make all doc

/bin/sh: line 1: asciidoc: command not found
make[1]: *** [git-add.html] Error 127
make[1]: Leaving directory `/root/src/git/Documentation'
make: *** [doc] Error 2

需要安装 asciidoc

4.1 安装asciidoc:

到官网下载asciidoc

http://www.methods.co.nz/asciidoc/index.html

http://sourceforge.net/projects/asciidoc/

cp asciidoc-8.5.2.tar.gz /root/src

cd /root/src

tar xvfz asciidoc-8.5.2.tar.gz

cd asciidoc-8.5.2

./configure

sudo make install

再接着安装git

cd /root/src/git

make all doc

等待等待,又出现:

/bin/sh: line 1: xmlto: command not found
make[1]: *** [git-add.1] Error 127
make[1]: Leaving directory `/root/src/git/Documentation'
make: *** [doc] Error 2
4.2 安装xmlto

yum install xmlto

再接着安装git

cd /root/src/git

make all doc

等待等待, 出现很多错误

I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
/root/src/git/Documentation/gitglossary.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
不过最后算是通过了。

8 make install install-doc install-html

顺利执行,看看新的版本

[root@seti ~]# git --version
git version 1.7.1.575.gf526

上一篇:GIT → 03:Git的下载和安装


下一篇:搭建localhost的目录环境