先到github上下载git的tar包 https://github.com/git/git/releases
上传到linux并解压
tar -zxvf git-2.19.1.tar.gz
进入目录配置
cd git-2.19.0
先执行 yum install autoconf 因为要用到make configure,不然会报错
yum install autoconf
make configure
./configure --prefix=/usr/local/git
安装
yum -y install gcc automake autoconf libtool make 先安装gcc 才能执行make命令
因为是没有文件openssl/ssl.h,安装需要的依赖,使用命令:
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
make && make install
安装成功
配置全局路径
export PATH="/usr/local/git/bin:$PATH"
source /etc/profile
查看
git --version