通常linux自带git版本很旧,会有必定问题,能够先卸载系统自带git:html
yum remove git
下载及安装git:linux
wget https://github.com/git/git/archive/v2.2.1.tar.gz
tar zxvf v2.2.1.tar.gz
cd git-2.2.1
make configure
./configure --prefix=/usr/local/git/ --with-iconv=/usr/local/libiconv --with-curl=/home/{username}/curl/
make
make install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc
配置curl很重要。
可能出现的问题,少一些系统库:
1.编译git时报错: zlib.h: No such file or directory
缺乏 zlib的头文件, 开发包没装,git
yum install zlib (系统默认已经装上)
yum install zlib-devel
解决github
2.提示make cc Command not found
bash
yum install gcc
3.make[1]: * [perl.mak] Error 2 make: * [perl/perl.mak] Error 2
执行:curl
yum install perl-ExtUtils-MakeMaker package.
进行安装
出现错误二: /bin/sh: msgfmt: command not found
url
yum install gettext-devel
可解决!.net
4./bin/sh: line 1: asciidoc: command not found
安装asciidoc:
到官网下载asciidoc
http://www.methods.co.nz/asciidoc/index.html
http://sourceforge.net/projects/asciidoc/code
cp asciidoc-8.5.2.tar.gz /root/src
xml
cd /root/src
tar xvfz asciidoc-8.5.2.tar.gz
cd asciidoc-8.5.2
./configure
sudo make install
5./bin/sh: line 1: xmlto: command not found
yum install xmlto
6.若是出现http/https异常,安装curl