Linux环境下通过压缩包安装Git
Linux环境下通过压缩包安装Git
1、环境准备
CentOS7
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
yum -y install wget
yum install zip
yum install unzip
yum remove git #删除已有git
2.创建一个文件夹,用来安装git
mkdir /usr/local/git
cd /usr/local/git
3、下载git源码并解压
wget https://github.com/git/git/archive/v2.3.0.zip
unzip v2.3.0.zip
cd git-2.3.0/
4、配置参数进行编译,设置自己的安装路径
make prefix=/usr/local/git all
make prefix=/usr/local/git install
5.编辑环境变量
vi /etc/profile
#在文件的最后一行,添加该内容,然后保存退出 export PATH=$PATH:/usr/local/git/bin
source /etc/profile
git --version