centos7下git版本升级及gitlab安装

本文详细介绍了如何在CentOS系统中升级Git版本,包括安装依赖包、卸载旧版本及编译安装最新版本等步骤,并提供了验证升级成功的命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

centos系统自带的git版本过低,当使用git拉取、推送、克隆的时候可能会报错,常见的错误:

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 --version

 

 接下来就是介绍git版本升级的操作:(注意标紫的文字)

0)安装依赖包
[root@localhost ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
[root@localhost ~]# yum install  gcc perl-ExtUtils-MakeMaker
 
1)卸载系统自带的低版本git(1.8.3)
[root@localhost ~]# git --version
git version 1.8.3
[root@localhost ~]# yum remove git
  
2)编译安装最新的git版本
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget https://www.kernel.org/pub/software/scm/git/git-2.7.3.tar.xz     下载git-2.7.3.tar.xz压缩包
[root@localhost src]# tar -vxf git-2.7.3.tar.xz   解压缩
[root@localhost src]# cd git-2.7.3     
[root@localhost git-2.7.3]# make prefix=/usr/local/git all  编译
[root@localhost git-2.7.3]# make prefix=/usr/local/git install  安装
[root@localhost git-2.7.3]# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile 加git到环境变量
[root@localhost git-2.7.3]# source /etc/profile  
[root@localhost ~]# git --version
git version 2.7.3
  
======================================================================
 
 
 
在服务器centos系统上完成git升级后,接下来在服务器上安装GITLAB,请参考漠效的博客https://blog.youkuaiyun.com/gx_1_11_real/article/details/79406427

转载于:https://www.cnblogs.com/qtiger/p/9290897.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值