阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Linux下安装Git

154次阅读
没有评论

共计 662 个字符,预计需要花费 2 分钟才能阅读完成。

1、使用 yum 安装

1
2
# yum -y install git
# yum remove git

2、源代码安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- 安装依赖的包 
# yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker zlib
# cd /usr/local
---- 下载 git 源码
# wget https://github.com/git/git/archive/v2.21.0.tar.gz
---- 解压 git 源码
# tar -zxvf v2.21.0.tar.gz
# cd git-2.21.0/
# mkdir /usr/local/git
---- 编译安装到指定目录
# make prefix=/usr/local/git all
# sudo make prefix=/usr/local/git install
# vim /etc/profile
---- 添加在文件的最后一行
export PATH=/usr/local/git/bin:$PATH
# source /etc/profile
# git --version

3、FAQ

1、如果解压时出现报错,建议手动下载 git 源码包然后上传到服务器
1
2
3
4
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-10-11发表,共计662字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中