centos7 安装git

查看yum源仓库的

yum info git 

卸载低版本git

yum remove git

依赖库安装

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install  gcc perl-ExtUtils-MakeMaker

下载最新版的git

wget https://github.com/git/git/archive/v2.17.0-rc2.tar.gz

解压到相应的目录

tar zxf v2.17.0-rc2.tar.gz

安装git

# cd git-2.17.0-rc2
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install

添加到环境变量

# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc

查看版本号

git --version




暂无评论
发表新评论