拉取git源码
bash
git clone https://github.com/git/git.git
切换到想要的版本
bash
cd git
git reset --hard 7a1903a
安装编译环境
bash
yum groupinstall -y "Development Tools"
删除旧的 git
bash
rpm -qa | grep git
yum remove git
如果不是yum安装的,就搜索git命令在哪里删掉它即可
which git
在源码主路径下生成配置文件 (Makefile)
bash
make configure
指定结果无存放路径
bash
./configure --prefix= /usr/local/git --with-openssl=/usr/local/bin/openssl
编译 用 4个线程
bash
make -j 4
安装
bash
make install