构建机部署之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
相关推荐
爱丶狸9 小时前
Grafana_Zabbix_ImageRenderer_部署与前端操作手册
linux·前端·zabbix·grafana·kylin
Elasticsearch9 小时前
将 Embedding 模型加载到 Elasticsearch 中
elasticsearch
k4m7v2pz10 小时前
把 Bevy 0.14 游戏移植到 R36S 掌机:一场与“无窗口系统“的搏斗
linux·rust·bevy·r36s·rk3326·开源掌机
木子欢儿11 小时前
Intel 架构的 MacBook Pro 运行 Linux 发热量高解决
linux·运维·服务器
.Hypocritical.13 小时前
Git 入门教程
git
会编程的土豆14 小时前
Go 模板初识
linux·运维·服务器
regret~16 小时前
【记录】网络路由、转发与网卡隔离
linux·服务器·网络
aFakeProgramer17 小时前
Linux版本兼容问题及RTA-VRTE环境配置笔记
linux·笔记
Zhu75817 小时前
在Ubuntu24快速配置专用SFTP
linux·sftp
码农客栈17 小时前
Linux 内核顶层 Makefile 详解
linux