环境准备:
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
下载:https://github.com/git/git
编译安装:
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
标签:profile,git,安装,devel,prefix,usr,linux,local From: https://www.cnblogs.com/chensuqian/p/16832012.html