Files
blog/source/_posts/linux/gitInstallation.md
2025-03-29 23:29:16 +08:00

1.3 KiB

title, date, updated, tags, categories, keywords, description, top_img, comments, cover, copyright, copyright_author, copyright_author_href, copyright_url, copyright_info
title date updated tags categories keywords description top_img comments cover copyright copyright_author copyright_author_href copyright_url copyright_info
git安装 2021-11-21 2021-11-21
git
linux
linux
git
git
linux
git安装 https://i.loli.net/2021/11/21/kVIqrRQlpSD2avc.jpg true https://i.loli.net/2021/11/21/kVIqrRQlpSD2avc.jpg true xzh http://xxzhx.cn http://xxzhx.cn 著作权归作者所有。商业转载请联络作者获得授权,非商业转载请注明出处。

git安装

下载git包

下载地址

下载git包

上传服务器并解压安装

解压

tar -zxvf git-2.34.0.tar.gz

安装依赖

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

检验配置并设置安装路径

./configure --prefix=/usr/local/git

编译&安装

make && make install

配置环境变量

vim /etc/profile

环境变量

# git环境变量
export GIT_HOME=/usr/local/git
export PATH=$PATH:$GIT_HOME/bin

刷新配置

source /etc/profile

安装完成

查看版本