1:下载git
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.30.1.tar.gz
2:解压
tar -zxvf git-2.30.1.tar.gz
3:进入文件夹
cd git-2.30.1
4:安装所需依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
5:编译
make prefix=/usr/local/git all
6:安装
make prefix=/usr/local/git install
7:修改环境变量文章来源:https://www.toymoban.com/news/detail-506140.html
-
vi /etc/profile
- 最下面加上:
export PATH=$PATH:/usr/local/git/bin
- 刷新环境变量
source /etc/profile
8:检查文章来源地址https://www.toymoban.com/news/detail-506140.html
git --version
到了这里,关于Centos 安装 git的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!