CentOS 安装 git 教程

CentOS 安装 git 教程

移除自带 git

yum remove git

安装依赖

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
yum install gcc perl-ExtUtils-MakeMaker

下载安装包

cd /usr/local/src/
wget https://www.kernel.org/pub/software/scm/git/git-2.23.0.tar.xz

解压缩安装包

tar -vxf git-2.23.0.tar.xz
cd git-2.23.0

编译执行

make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
source /etc/profile

建立快捷方式

ln -s /usr/local/git/bin/git /usr/bin/git -f
上一篇:2021-06-12


下一篇:static 还是readonly 还是static readonly