构建机部署之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
相关推荐
米高梅狮子7 小时前
03.网络类服务实践
linux·运维·服务器·网络·kubernetes·centos·openstack
June`7 小时前
网络编程时内核究竟做了什么???
linux·服务器·网络
楼兰公子8 小时前
RK3588 + Linux7.0.3 网络工程调试错误速查手册
linux·网络·3588
Elnaij8 小时前
Linux系统与系统编程(9)——自设计shell与基础IO
linux·服务器
IMPYLH8 小时前
Linux 的 unexpand 命令
linux·运维·服务器·bash
|_⊙9 小时前
Linux 文件知识 补充
linux·运维·服务器
落羽的落羽10 小时前
【算法札记】练习 | Week4
linux·服务器·数据结构·c++·人工智能·算法·动态规划
Mortalbreeze10 小时前
深度理解文件系统 ---- 从磁盘存储到内核存储
大数据·linux·数据库
C-200210 小时前
基于 JumpServer 容器化部署 ES 集群
大数据·elasticsearch·搜索引擎
C137的本贾尼12 小时前
Git基本操作(四):删除文件
git