构建机部署之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
相关推荐
小丑西瓜6666 小时前
CMake基础用法,cmake_minimum_required,project,add_executable
linux·服务器·c++·camke
晚风吹长发7 小时前
初步了解Linux中的命名管道及简单应用和简单日志
linux·运维·服务器·开发语言·数据结构·c++·算法
C++ 老炮儿的技术栈7 小时前
不调用C++/C的字符串库函数,编写函数strcpy
c语言·开发语言·c++·windows·git·postman·visual studio
大熊背7 小时前
多核架构中,RTOS小核跑sensor 的normal模式,大核linux核跑WDR模式,将小核的曝光时间映射到WDR模式中的曝光时间的方法
linux·自动曝光·wdr
全栈测试笔记7 小时前
异步函数与异步生成器
linux·服务器·前端·数据库·python
weixin_462446237 小时前
Linux 下使用 xfreerdp3 远程连接 Windows(从安装到实战使用)
linux·运维·windows
EndingCoder8 小时前
配置 tsconfig.json:高级选项
linux·前端·ubuntu·typescript·json
爱丶狸8 小时前
Linux三剑客之sed
linux·运维·服务器
清风~徐~来8 小时前
【Git】远程操作
git
仗剑恬雅人9 小时前
LINUX数据库高频常用命令
linux·运维·服务器·数据库·ssh·运维开发