构建机部署之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
相关推荐
mounter6251 小时前
走向长时运行:引入协程(Coroutines),打破 BPF 程序的“一堂到底”限制
linux·ebpf·kernel
Elasticsearch1 小时前
从课程表到 AI 岗位:我如何用 Elastic Agent Builder 构建 SkillGap Radar
elasticsearch
六点_dn2 小时前
Linux学习笔记-shell运算符
linux·笔记·学习
hehelm2 小时前
IO 多路复用 — Reactor
linux·服务器·网络·数据库·c++
浅止菌3 小时前
嵌入式项目Makefile越写越乱?一张万能模板+5个技巧,告别重复劳动
linux
咋吃都不胖lyh3 小时前
提交(Commit)到本地的 Git 仓库,然后才能推送(Push)到远程的 Git 仓库
git
刘某的Cloud4 小时前
手工配置nginx的systemd服务
linux·运维·网络·nginx·systemd
FREEDOM_X4 小时前
嵌入式Linux摄像头采集与图像处理
linux·图像处理·ubuntu
studytosky4 小时前
OpenClaw 入门与 Skill 开发
linux·服务器·ai编程
kaoa0004 小时前
Linux入门攻坚——82、kvm虚拟化-2
linux·运维·服务器