linux安装git
环境准备:
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
下载:https://github.com/git/git
wget https://github.com/git/git/archive/refs/tags/v2.30.0.tar.gz
编译安装:
make prefix=/usr/local/git all
make prefix=/usr/local/git install
设置环变量:
修改文件profile
vim /etc/profile
然后在文件的最后一行,添加下面的内容,然后保存退出。
export PATH=/usr/local/git/bin:$PATH
使用source命令立即生效
source /etc/profile
验证:
git --version