构建机部署之git安装(Linux)

这里是通过源码编译的方式安装,如果对版本没有要求,可以通过yum命令直接安装。

  1. 如果已有安装的git,需要卸载掉
    yum remove git
  2. 到github自行选择版本下载:github git
  3. 将安装包上传到服务器并解压
    tar -zxvf git-版本号.tar.gz
  4. 安装git前安装可能需要的依赖
bash 复制代码
yum install curl-devel expat-devel openssl-devel zlib-devel gcc-c++ 
yum install perl-ExtUtils-MakeMaker automake autoconf libtool make
  1. 编译安装git
bash 复制代码
cd git解压目录
make configure
./configure --prefix=/usr/local/git
make profix=/usr/local/git
make install
  1. 将git加入环境变量
    编辑配置文件
    vim /etc/profile
    末尾增加
bash 复制代码
export GIT_HOME=/usr/local/git
export PATH=$PATH:$GIT_HOME/bin

刷新profile配置文件

source /etc/profile

  1. 查看git版本
    git --version
相关推荐
苏宸啊5 小时前
Linux权限
linux·运维·服务器
xqhoj5 小时前
Linux——make、makefile
linux·运维·服务器
张童瑶6 小时前
Linux 在线安装编译Python3.11
linux·运维·python3.11
Shi_haoliu6 小时前
SolidTime 在 Rocky Linux 9.5 上的完整部署流程
linux·运维·nginx·postgresql·vue·php·laravel
Lkygo6 小时前
LlamaIndex使用指南
linux·开发语言·python·llama
Zhongyi_Li6 小时前
git merge的一些记录
git
qq_254617777 小时前
nslookup 这个命令解析dns,和系统接口gethostbyname解析区别在哪?
linux·网络
HIT_Weston7 小时前
100、【Ubuntu】【Hugo】搭建私人博客:元信息&翻译(一)
linux·运维·ubuntu
自由的好好干活8 小时前
UBI镜像文件打包与编辑
linux·嵌入式硬件
shawnyz8 小时前
RHCSE--ansible1-入门和模块
linux·运维·ansible