git clone报错,如下图
解决方法:git版本过低问题
通过git --version查看版本,可以查看到是1.7.1版本的,需要卸载重新装2.2.1版本的步骤如下:
\ # yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
# yum install gcc perl-ExtUtils-MakeMaker
然后卸载
#yum remove git
下载v2.2.1版本
#wget https://github.com/git/git/archive/v2.2.1.tar.gz
如果wget命令不识别,则需要安装yum -y install wget
# tar zxvf v2.2.1.tar.gz
# cd git-2.2.1
# make configure
# ./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
# make all doc
如果make这里报如下错误
xmlto: command not found
make[1]: *** [git-add.1] Error 127
make[1]: Leaving directory `/root/src/git/Documentation’
make: *** [doc] Error 2
则需要安装xmlto,执行yum install xmlto命令,然后重新执行make all doc 命令
# make install install-doc install-html
# echo “export PATH=$PATH:/usr/local/git/bin” >> /etc/bashrc
# source /etc/bashrc
查看git版本为2.2.1安装成功
测试问题解决