yum -y install git
此方法安装到 /usr/libexec/git-core 目录中,安装版本比较老
github地址:
http://git-scm.com/download/linux
官网地址:
http://git-scm.com/download/linux
任意目录
tar -zxvf git-2.33.1.tar.gz
yum install gcc-c++ perl-ExtUtils-MakeMaker
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum remove git
进入文件夹:
cd git-2.33.1
make命令编译:
make prefix=/usr/local/git all
make install命令安装:
make prefix=/usr/local/git install
方法1 :
echo 'export PATH=$PATH:/usr/git/bin' >> /etc/profile
source /etc/profile
方法2:
vi /etc/profile
底部追加:
export PATH=$PATH:/usr/local/git/bin
:wq 保存退出
source /etc/profile