linux 下 git 的升级或按装

2018-06-05  本文已影响0人  郭靖_0179

(1)执行命令:yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker

(2)卸载旧版本git: yum remove git

(3)下载git: wget https://github.com/git/git/archive/v2.16.2.tar.gz

(4)解压:tar xzf git-1.9.0.tar.gz

(5)进入解压后的git安装目录:cd git-xxx

(6)编译:make prefix=/usr/local/git all

(7)安装:make prefix=/usr/local/git install

(8)编辑环境变量配置(给到所有用户):vim /etc/profile

(9)profile文件末尾追加:export PATH=$PATH:/usr/local/git/bin

(10)刷新配置:source /etc/profile

(11)查看版本:git —version

上一篇下一篇

猜你喜欢

热点阅读