centos7卸载自带git升级到最新版git记录
星期三, 2019-05-15 | Author: Lee | linux | 2,182 views
git版本升级到高版本(git-2.21.0)。下面说下git升级的操作记录
[root@IA ~]# git --version git version 1.8.3 |
0)安装依赖软件
[root@IA ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc [root@IA ~]# yum install gcc perl-ExtUtils-MakeMaker |
1)卸载系统自带的底版本git(1.8.3)
[root@IA ~]# git --version git version 1.8.3 [root@IA ~]# yum remove git |
2)编译安装最新的git版本
[root@IA ~]# cd /usr/local/src/ [root@IA src]# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.21.0.tar.xz [root@IA src]# tar -vxf git-2.21.0.tar.xz [root@IA src]# cd git-2.21.0 [root@IA git-2.21.0]# make prefix=/usr/local/git all [root@IA git-2.21.0]# make prefix=/usr/local/git install [root@IA git-2.21.0]# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile [root@IA git-2.21.0]# source /etc/profile [root@IA ~]# git --version git version 2.21.0 |
如果是非root用户使用git,则需要配置下该用户下的环境变量
[app@IA ~]$ echo "export PATH=$PATH:/usr/local/git/bin" >> ~/.bashrc [app@IA ~]$ source ~/.bashrc [app@IA ~]$ git --version git version 2.21.0 |
文章作者: Lee
本文地址: https://www.pomelolee.com/1875.html
除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址
No comments yet.
Leave a comment
Search
相关文章
热门文章
最新文章
文章分类
- ajax (10)
- algorithm-learn (3)
- Android (6)
- as (3)
- computer (85)
- Database (30)
- disucz (4)
- enterprise (1)
- erlang (2)
- flash (5)
- golang (3)
- html5 (18)
- ios (4)
- JAVA-and-J2EE (186)
- linux (143)
- mac (10)
- movie-music (11)
- pagemaker (36)
- php (50)
- spring-boot (2)
- Synology群晖 (2)
- Uncategorized (6)
- unity (1)
- webgame (15)
- wordpress (33)
- work-other (2)
- 低代码 (1)
- 体味生活 (40)
- 前端 (21)
- 大数据 (8)
- 游戏开发 (9)
- 爱上海 (19)
- 读书 (4)
- 软件 (3)