构建机部署之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
相关推荐
CHANG_THE_WORLD34 分钟前
12.总结:深入理解 Linux I/O 多路复用:select、poll、epoll 全解析
linux·运维·服务器
风曦Kisaki1 小时前
# Linux笔记:操作系统优化与资源管理
linux·运维·服务器·笔记
Mr.HeBoYan2 小时前
一次持续三天才出现的丢包故障——深入解析 DPDK Memory Ordering、rte_ring 与 CPU Memory Barrier (下)
linux·网络·算法·架构·dpdk
Discipline~Hai4 小时前
ARM01-ARM体系架构
linux·c语言·arm开发·架构
leoZ2314 小时前
Git 集成实战完全指南(四):Git 冲突解决
大数据·git·elasticsearch
RisunJan4 小时前
Linux命令-screen(终端复用器)
linux·运维
啊哦1115 小时前
安装VMware Workstation
linux·运维·服务器
持敬chijing5 小时前
Linux基础命令与目录命令
linux·运维·服务器
码上上班5 小时前
Elasticsearch课程
大数据·elasticsearch·搜索引擎
yunwei375 小时前
实证研究:AI Agent 规则需要上下文与分层强制执行
linux·安全·ai编程