构建机部署之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
相关推荐
小小、码农17 分钟前
Linux进程概念
linux·服务器·网络
Nebula嵌入式8 小时前
【C语言】09-深入解析main函数
linux·c语言·开发语言·嵌入式
Dxy12393102169 小时前
Linux 编译安装 Python 3.12.10(多版本共存,不破坏系统Python)
linux·运维·python
维基框架10 小时前
OpenAI在给Git做优化 上游行为要变了
人工智能·git
1名持续学习的码农10 小时前
GPT Plus、GPT Pro用户第一次用Codex,项目权限和Git分支怎么设置?
人工智能·git·gpt·elasticsearch·ai编程·codex
xz驱动分享11 小时前
Linux DMA 子系统学习笔记
linux·dma·rk3588·嵌入式软件
小罗水12 小时前
附录A 各微服务完整 application.yml 配置汇总
数据库·elasticsearch·微服务
w678200712 小时前
Prisma不能优雅的支持DTO,试试Vona ORM吧
linux·运维·ubuntu
Darkwanderor12 小时前
Linux系统编程实战项目:模拟实现shell
linux·c++
Elasticsearch14 小时前
使用 Gemma、Hugging Face 和 Elasticsearch 构建 RAG 系统
elasticsearch