赞
踩
下载链接: https://github.com/git/git/tags
- # 下载Git安装包
- wget https://github.com/git/git/archive/refs/tags/v2.40.0.tar.gz
-
- # 解压安装包
- tar -zxvf v2.40.0.tar.gz
- # 安装编译源码所需依赖
- yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
-
- # 卸载旧版本git
- yum remove git
- # 编译Git
- cd git-2.40.0
- make prefix=/usr/local/git all
-
- # 安装Git
- make prefix=/usr/local/git install
- vim /etc/profile
-
- # 文件底部添加配置,然后 esc 输入 :wq 保存退出即可
- export PATH=$PATH:/usr/local/git/bin
-
- # 使Git环境变量生效
- source /etc/profile
git --version
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。