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/refs

fatal: HTTP request failed

解決方法:

帶着問題網上走一圈,查到資料說是 git 版本問題,建議升級到 1.8.3 以上。

shell > git --version
git version 1.7.1

# 好吧,那就升級。

shell > yum -y remove git
shell > yum -y install perl cpio autoconf tk zlib-devel libcurl-devel openssl-devel expat-devel gettext-devel perl-ExtUtils-MakeMaker

shell > cd /usr/local/src
shell > wget https://www.kernel.org/pub/software/scm/git/git-2.10.0.tar.gz
shell > tar zxf git-2.10.0.tar.gz
shell > cd git-2.10.0
shell > autoconf
shell > ./configure
shell > make
shell > make insntall

# 建議不要 ./configure; make; make install ,出問題不好排查

shell > echo "PATH=$PATH:/usr/local/bin/" >> /etc/profile; source /etc/profile

shell > git --version
git 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/locale'
Can't 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] 錯誤 2
make: *** [perl/perl.mak] 錯誤 2

2、未安裝 expat-devel 報錯如下:

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

# 如果是 https 應該是未安裝 libcurl-devel ,建議按照文檔都裝上。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM