centos7编译安装git
安装依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker
下载源码
wget https://www.kernel.org/pub/software/scm/git/git-2.15.1.tar.gz
解压文件
tar zxvf git-2.15.1.tar.gz
配置安装目录并且编译和安装
./configure --prefix=/usr/local/git-2.15.1 && make install
将修改profile文件
vi /etc/profile
#将git的路径加进去
export PATH="$PATH:/usr/local/git-2.15.1/bin"
- 立即生效配置的变量
source /etc/profile
- 检查git
git --version