一.安装git
1.下载git-2.15.1.tar.gz
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.15.1.tar.gz
2.解压
tar -xvf git-2.15.1.tar.gz
cd git-2.15.1
3.安装gcc(用来编译git)
sudo yum install gcc
4.安装openssl
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
5.编译和安装git到/usr/local/git
make prefix=/usr/local/git all
make prefix=/usr/local/git install
6.配置环境变量
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
source /etc/profile
7.查看结果
git --version
出现版本号则说明安装成功
网友评论