Centos7更新git版本
2023-09-14 09:15:55 时间
Centos7更新git版本
背景描述
CentOS7上的Git版本太陈旧,在使用过程中会遇到问题,因此需要升级git版本。
# git --version
git version 1.8.3.1
# 系统版本:(CentOS 7.6)
# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
编译安装git2.9
参考: https://blog.csdn.net/u010046908/article/details/103956459
安装依赖包
源代码安装和编译git,需安装一些依赖。
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc -y
yum install gcc perl-ExtUtils-MakeMaker -y
卸载旧版本
yum remove git
git源码包下载地址
https://mirrors.edge.kernel.org/pub/software/scm/git/
安装步骤
cd /usr/local/src/
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
tar -xvf git-2.9.5.tar.gz
cd git-2.9.5/
./configure --prefix=/usr/local/git all
make -j && make install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc
验证版本
[root@localhost ~]# git --version
git version 2.23.0
非root用户使用
如果是非root用户使用git
,则需要配置下该用户下的环境变量。
$ echo "export PATH=$PATH:/usr/local/git/bin" >> ~/.bashrc
$ source ~/.bashrc
Centos7使用yum安装git224版本
相关文章
- [Git] Git fetch和git pull的区别
- CentOS7 防火墙设置
- 【问题解决方案】CentOS7替换yum的问题:使用yum makecache出现File contains no section headers
- [Practical Git] Filter commit history with git log arguments
- [Practical Git] Format commit history with git log arguments
- Centos7系统配置上的变化
- centos7升级ruby
- 【学习总结】Git学习-GIT工作流-千峰教育(来自B站)
- [Git] Recover Local Changes from `git reset --hard` with `git reflog`
- [Git] Use and Compare the Different git Reset Options: --hard, --soft, and --mixed
- [Git] Use git add --patch for better commit history and mitigating bugs
- Centos7 RKE部署高可用k8s集群
- Centos7 KVM桥接网卡
- centos7 yum安装docker
- Linux centos7 配置java环境变量
- Centos7升级内核版本
- centos7安装Logwatch配合msmtp邮件客户端发送服务器监控分析日志
- Git 管理工具 SourceTree 的使用(上手简单,不熟悉git命令的开发者必用)
- 一文吃透 VS Code+Git 操作(vs code中git的相关配置与使用)
- CentOS7 下安装 Redis
- 【Git总结大全】git操作从入门到实战(总结篇)
- 【Git技巧】第八篇 git历史提交版本回退(可切换任意已经提交的版本)
- 【Git技巧】第五篇 git log 查看历史提交记录
- CentOS7 部署 Maxwell
- GIT ---- 常用 Git 命令清单