用git clone项目的http路径时,出现了下面错误提示:
-
Initialized empty Git repository in ......
-
error: The requested URL returned error: 401 Unauthorized while accessing
-
fatal:HTTP request failed
由于Git服务于Git版本之间常存在依赖关系,因此解决的思路是升级Git,目前默认的yum安装的Git版本是1.7.1(Centos6.5)
-
http://pkgs.repoforge.org/rpmforge-release/
上面地址中有用于更新软件仓库的RPM包,目前最新的是0.5.3.1
-
[ ] rpmforge-release-0.5.3-1.el5.rf.i386.rpm 20-Mar-2013 16:59 12K RHEL5 and CentOS-5 x86 32bit
-
[ ] rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm 20-Mar-2013 16:59 12K RHEL5 and CentOS-5 x86 64bit
-
[ ] rpmforge-release-0.5.3-1.el6.rf.i686.rpm 20-Mar-2013 16:59 12K RHEL6 and CentOS-6 x86 32bit
-
[ ] rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm 20-Mar-2013 16:59 12K RHEL6 and CentOS-6 x86 64bit
-
[ ] rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm 12-Jun-2014 03:42 12K
-
[ ] rpmforge-release-0.5.3-1.rf.src.rpm 12-Jun-2014 03:43 8.4K Distribution independent source
系统是32位的,直接用rpm安装:
点击(此处)折叠或打开
-
rpm -i http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
然后更新软件仓库
点击(此处)折叠或打开
-
yum --enablerepo=rpmforge-extras update
可以查看当前支持的可安装的Git版本
点击(此处)折叠或打开
-
yum --enablerepo=rpmforge-extras provides git
更新git(实际上,前面update的操作已经将git的版本更新了,因此下面的操作实际上是不需要的)
点击(此处)折叠或打开
-
yum --enablerepo=rpmforge-extras install git
查看一下Git的版本
点击(此处)折叠或打开
-
[root@vmware-hw-02 ~]# git --version
-
git version 1.7.12.4
已经升级到1.7.12.4,再次git clone http://,可以正常clone。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
另外,看到有文章介绍到Git 1.8的安装方式,我按照该方法可以升级到1.8.3.1,下面简单描述一下:
点击(此处)折叠或打开
-
wget -O /etc/yum.repos.d/PUIAS_6_computational.repo https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/install/centos/PUIAS_6_computational.repo
-
wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-puias http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias
-
rpm -qa gpg*
-
yum repolist
-
yum --enablerepo=PUIAS_6_computational install git
-
git --version
-
git version 1.8.3.1
阅读(2946) | 评论(0) | 转发(0) |