Centos 7安装最新版git

https://github.com/git/git/tags在这里选择版本下载

wget https://github.com/git/git/archive/v2.28.0.tar.gz

然后解压

tar -zxvf v2.28.0.tar.gz

cd git-2.28.0

make configure #生成配置文件,如果报autoconf错 ,请先安装 yum install install autoconf automake libtool

./configure --prefix=/usr/local/git

make && make install

yum remove git #删除旧的git

vim /etc/profile #配置环境变量

#在大概52行加入
GIT_HOME=/usr/local/git
PATH=$PATH:$GIT_HOME/bin

source /etc/profile #刷新


 

posted @ 2020-08-31 16:46  龙影123  阅读(660)  评论(0)    收藏  举报