首页 > 代码库 > Git 版本导致 clone 故障

Git 版本导致 clone 故障


问题描述:

git clone 报错如下:

Initialized empty Git repository in /root/project_php/.git/error: The requested URL returned error: 401 Unauthorized while accessing http://tone.verru.cn:88/project_php.git/info/refsfatal: HTTP request failed

解决方法:

带着问题网上走一圈,查到资料说是 git 版本问题,建议升级到 1.8.3 以上。

shell > git --versiongit version 1.7.1

# 好吧,那就升级。

shell > yum -y remove gitshell > yum -y install perl cpio autoconf tk zlib-devel libcurl-devel openssl-devel expat-devel gettext-devel perl-ExtUtils-MakeMakershell > cd /usr/local/srcshell > wget https://www.kernel.org/pub/software/scm/git/git-2.10.0.tar.gzshell > tar zxf git-2.10.0.tar.gzshell > cd git-2.10.0shell > autoconfshell > ./configureshell > makeshell > make insntall

# 建议不要 ./configure; make; make install ,出问题不好排查

shell > echo "PATH=$PATH:/usr/local/bin/" >> /etc/profile; source /etc/profileshell > git --versiongit version 2.10.0

# 再来克隆,发现正常。

shell > git clone http://tone.verru.cn:88/project_php.git

过程中小问题:

1、未安装 perl-ExtUtils-MakeMaker 报错如下:

/usr/bin/perl Makefile.PL PREFIX=/usr/local INSTALL_BASE=‘‘ --localedir=/usr/local/share/localeCant locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 3.BEGIN failed--compilation aborted at Makefile.PL line 3.make[1]: *** [perl.mak] 错误 2make: *** [perl/perl.mak] 错误 2

2、未安装 expat-devel 报错如下:

git clone: fatal: Unable to find remote helper for http

# 如果是 https 应该是未安装 libcurl-devel ,建议按照文档都装上。

Git 版本导致 clone 故障