热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

centos升级git

在使用git pull、git push、git clone的时候,或者在使用jenkins发版的时候,可能会报类似如下的错误: error: The re

在使用git pull、git push、git clone的时候,或者在使用jenkins发版的时候,可能会报类似如下的错误:
error: The requested URL returned error: 401 Unauthorized while accessing https://git.oschina.net/zemo/demo.git/info/refs
fatal: HTTP request failed

这个一般是由于服务器本身自带的git版本过低造成的,一般只需要将git版本升级到高版本即可。下面说下git升级的操作记录。

0)安装依赖软件
[root@1 ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
[root@1 ~]# yum install gcc perl-ExtUtils-MakeMaker1)卸载系统自带的底版本git(1.7.1)
[root@localhost ~]# git --version
git version 1.7.1
[root@localhost ~]# yum remove git2)编译安装最新的git版本
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget https://www.kernel.org/pub/software/scm/git/git-2.15.1.tar.xz
[root@localhost src]# tar -vxf git-2.15.1.tar.xz
[root@localhost src]# cd git-2.15.1
[root@localhost git-2.15.1]# make prefix=/usr/local/git all
[root@localhost git-2.15.1]# make prefix=/usr/local/git install
[root@localhost git-2.15.1]# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
[root@localhost git-2.15.1]# source /etc/profile[root@localhost ~]# git --version
git version 2.15.1


推荐阅读
author-avatar
kkkkkkkkkkkk1982_799
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有