构建机部署之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
相关推荐
心之王者71612 小时前
【Linux】多线程:从线程控制、同步互斥到经典并发模型
linux·运维·服务器
Doctor_Strange_DML12 小时前
图像编辑模型服务部署过程记录
linux·缓存·docker·ai
棒子胡豆12 小时前
Git总结
git
笔记本note17 小时前
Linux 文件系统与设备文件
linux·服务器·文件系统
无足鸟ICT17 小时前
【RHCA+】_proc_pid_cmdline
linux·运维·服务器
学以智用18 小时前
CentOS Linux 文件操作详解
linux
饿了吃洗衣凝珠19 小时前
shell循环
linux·运维·服务器
代码不停20 小时前
Linux基础知识
java·linux·数据库
东风微鸣20 小时前
Linux台式机也能指纹识别登录验证啦
linux·指纹
Elasticsearch21 小时前
Elastic 获得全新的 AWS 数据能力认证
elasticsearch