> CentOS > CentOS教程 >

CentOS7 安装最新版Git

CentOS7 安装最新版Git

Git 地址:

https://github.com/git/git

安装wget

yum install -y wget
安装git

yum install -y git
安装gcc

yum install gcc
安装g++

yum install gcc-c++
下载git

wget -P /usr/software https://www.kernel.org/pub/software/scm/git/git-2.12.3.tar.gz
解压:

tar -zxvf git-2.12.3.tar.gz
安装依赖

yum install -y zlib-devel

yum install -y perl-ExtUtils-MakeMaker package
所有文件安装到指定目录,方便卸载

cd git-2.12.3
./configure --prefix=/usr/software/git && make install
配置环境变量

echo 'export PATH=$PATH:/usr/software/git/bin' > /etc/profile.d/git.sh
重启配置

source /etc/bashrc
查看是否安装成功

git --version
安装成功:

git version 2.12.3


(责任编辑:IT)