CentOS 6通过yum升级Git 具体安装步骤 参考

By francis_hao    Mar 9,2017

 

在一个新机器上推送代码到github上时出现了下面的问题

error: The requested URL returned error: 403 Forbidden while accessing https://github.com/xxxxxx
fatal: HTTP request failed

记得是版本的问题,查看yum源上的git最新版本,需要升级了

CentOS 6通过yum升级Git
具体安装步骤

参考

 

可是,当前的yum源并没有更高版本的安装包,这时候,最好的办法还是去官网。见【参考1】

有两种安装方式,源码安装和yum安装,这里选后者。

CentOS 6通过yum升级Git
具体安装步骤

参考

 

之后就是根据链接里的安装方法一步步操作,针对每种情况还设有Demo,讲的清楚明白

CentOS 6通过yum升级Git
具体安装步骤

参考

 

记录一下具体的安装步骤,只针对本机情况。

下载并安装rpm文件,以设置yum源

# wget https://centos6.iuscommunity.org/ius-release.rpm
# rpm -ivh ius-release.rpm

查看可安装的git安装包

# repoquery --whatprovides git

CentOS 6通过yum升级Git
具体安装步骤

参考

卸载1.7的git,安装2.11的git

# yum remove git
# yum install git2u

成功

CentOS 6通过yum升级Git
具体安装步骤

参考

 

 

 

CentOS 6通过yum升级Git
具体安装步骤

参考
本文由 刘英皓 创作,采用 知识共享 署名-非商业性使用-相同方式共享 3.0 中国大陆 许可协议进行许可。欢迎转载,请注明出处:
转载自:http://www.cnblogs.com/yinghao1991/p/6527706.html

 

 

 

参考

【1】 GIT官网 https://git-scm.com/download/linux

【2】 rpm和yum用法小记 http://blog.sina.com.cn/s/blog_5994f1ca0102wmbu.html