centos下载GIT代码错误时处理方法

在centos系统上下载Git代码时出现以下错误:
 
The requested URL returned error: 401 Unauthorized while accessing 
网上查找资料说是git版本的问题,系统用yum install git安装的 版本是 1.7.1 ,要解决此问题要安装更高版本的git
 
解决方案:
1.下载git源码
wget https://www.kernel.org/pub/software/scm/git/git-1.9.4.tar.gz
 
tar zxvf git-1.9.4.tar.gz
cd git-1.9.4
./autoconf
./configure --prefix=/usr/local
make
make出错了 Can't locate ExtUtils/MakeMaker.pm
解决这个错误方法是: yum install perl-ExtUtils-Embed -y
 
make install
2.最后别忘了删掉旧的git,并把新版本的git建立软链接到/usr/bin/git
# rm /usr/bin/git
# ln -s /usr/local/bin/git /usr/bin/git
posted @ 2018-01-26 14:28  不喝酒  阅读(182)  评论(0编辑  收藏  举报