原因:git 版本过低
解决方案:升级git
1、查看版本
git --version
2、安装依赖项
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
yum install gcc perl-ExtUtils-MakeMaker
3、卸载已安装git
yum remove git
4、编译安装新git
cd /usr/local/src/
wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz
tar -vxf git-2.9.5.tar.xz
cd git-2.9.5
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
source /etc/profile
5、如果是非root用户使用git,则需要配置下该用户下的环境变量
echo "export PATH=$PATH:/usr/local/git/bin" >> ~/.bashrc
source ~/.bashrc