构建机部署之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
相关推荐
大雪冬至686061258873 小时前
【一次 Elasticsearch 高基数聚合慢查询的定位与优化】
elasticsearch
dingdingfish3 小时前
TLPI 第52章 读书笔记:POSIX Message Queues
linux·mq·ipc·posix·message·tlpi
Elasticsearch4 小时前
Elasticsearch:如何使用 Connectors 接入数据到 Elastic Agent builder 里进行企业搜索
elasticsearch
wacsii4 小时前
【Linux进程(五)】进程控制全解析:从创建、终止、等待到程序替换
linux·服务器
七夜zippoe4 小时前
Nexent Linux 部署:用 deploy.sh
linux·服务器·docker·部署·ai智能体·nexent
去码头整点薯条985 小时前
NFS服务器
linux·运维·服务器
蜗牛一步步往上爬6 小时前
第一章 初识Linux shell
linux·运维·服务器
拂拉氏6 小时前
【知识讲解】 Linux线程中锁的认识
linux·互斥锁
无足鸟ICT6 小时前
【RHCA+】系统调优配置文件
linux·服务器