构建机部署之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
相关推荐
艾伦_耶格宇41 分钟前
【ELK】-4 logstash的搭建及操作
linux·运维·ubuntu·elk
mifengxing1 小时前
文件逻辑结构、物理结构与磁盘空闲存储空间管理
大数据·linux·运维·操作系统·计算机408
Elasticsearch3 小时前
向数据源提问:使用 Elasticsearch 和 Elastic Agent Builder 将代码搜索扩展到十亿行代码规模
elasticsearch
小此方3 小时前
Re:Linux系统篇(五十七)线程篇 · 十:基于环形缓冲的生产者消费者模型与信号量
linux·运维·驱动开发
fanged4 小时前
Linux的DD命令
linux·运维·服务器
凯尔萨厮4 小时前
Git(学习笔记)
笔记·git·学习
张洛闻Eren5 小时前
MySQL 管理复制拓扑【MySQL第四课】
linux·运维·数据库·mysql
-今昭-5 小时前
AnsibleVault加密配置及zabbix部署
大数据·elasticsearch·搜索引擎
xiaohua10095 小时前
Linux-JVM线程查询
linux·jvm
blueSatchel6 小时前
u-boot启动过程(bootROM到SPL到u-boot)
linux·u-boot