构建机部署之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
相关推荐
weixin_3077791328 分钟前
Python写入Shell文件使用Linux系统的换行符
linux·开发语言·python·自动化
liulilittle1 小时前
Linux Swap 文件配置与持久化(虚拟内存)
linux·运维·服务器
青梅橘子皮1 小时前
Linux---进程控制(2)(进程程序替换)
linux·c++·算法
零陵上将军_xdr1 小时前
从沙子到CPU——计算机硬件基础入门
linux·运维·硬件架构
vortex51 小时前
Linux 命令工具箱:util-linux 与 GNU Coreutils
linux·运维·gnu
荒--2 小时前
MSF 使用
linux·运维·服务器
狮子再回头2 小时前
relhat9.1 sshd配置
linux·服务器·网络
烁3473 小时前
liunx命令不完整版
linux·运维·服务器
vsropy3 小时前
cmake版本不对不能直接删/无法source
linux·运维·服务器
xcLeigh3 小时前
鸿蒙平台 gThumb 图片查看器适配实战:从 Linux GTK 到 Electron 鸿蒙壳工程
linux·electron·harmonyos·gnome·桌面环境·gthumb