您的位置:首页 > 运维架构 > Linux

CentOS 6.5 mini 安装Git-core

2013-12-12 21:16 471 查看
在使用Centos yum 源里面git 同步谷歌android 源码时,发现版本太低。无法从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 perl-devel expat-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 foundmake[1]: *** [git-add.1] Error 127make[1]: Leaving directory `/home/soft/git-1.8.5/Documentation'make: *** [doc] Error 2解决:
安装xmlto
# yum –y install xmlto
错误二:/bin/sh: line 1: docbook2x-texi: commandnot foundmake[1]: *** [user-manual.texi] Error 127make[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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  centos Git