章工运维 章工运维
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)

章工运维

业精于勤,荒于嬉
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)
  • linux

    • rsync

      • rsync用法及参数详解
      • rsync服务实现推送,拉取
    • dns

    • sed、awk、grep、find四剑客

    • LVM管理
    • sudo权限规划
    • linux修改网卡为eth0的两种方法
    • Logrotate入门了解及生产实践
    • linux中用dd命令来测试硬盘读写速度
    • linux 阿里云盘挂载错误
    • CentOS7安装Android SDK
    • centos7安装更新git
    • linux启动顺序
    • centos7升级openssl
    • expect工具的安装和使用方法
    • linux下使用v2ray
    • centos7安装java环境的两种方式
    • linux-centos7系统设置时区及同步时间
    • rsyslog日志系统:rsyslog配置文件
    • rsyslog的安装、使用、详解
    • safe-rm防止删除重要的文件
    • linux如何获取打开文件和文件描述符数量
    • LVS集群-DR模式
    • linux服务器安装ffmpeg
    • linux服务器安装samba
    • 使用openssl创建自签发证书
    • linux服务器部署next.js服务
    • linux服务器ionice命令使用方式
    • linux服务器curl命令常用操作
  • windows

  • 中间件

  • 网络

  • 安全

  • 存储

  • 防火墙

  • 数据库

  • 系统

  • docker

  • other

  • 监控

  • 运维
  • linux
章工运维
2023-04-03

centos7安装更新git

CentOS7上的Git版本太陈旧,在使用过程中会遇到问题,因此需要升级git (opens new window)版本。

# git --version
git version 1.8.3.1
# 系统版本:(CentOS 7.6)
# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core)
1
2
3
4
5

# 安装依赖包

源代码安装和编译git,需安装一些依赖。

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc -y
yum install  gcc perl-ExtUtils-MakeMaker -y
1
2

# 卸载旧版本

yum remove git
1

# 安装步骤

cd /usr/local/src/
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.38.1.tar.gz
tar -xvf git-2.38.1.tar.gz
cd git-2.38.1/

./configure --prefix=/usr/local/git all

make -j && make install

echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc

source /etc/bashrc
1
2
3
4
5
6
7
8
9
10
11
12

# 验证版本

[root@localhost ~]# git --version
git version 2.38.1
1
2
微信 支付宝
上次更新: 2023/04/21, 08:57:47

← CentOS7安装Android SDK linux启动顺序→

最近更新
01
shell脚本模块集合
05-13
02
生活小技巧(认知版)
04-29
03
生活小技巧(防骗版)
04-29
更多文章>
Theme by Vdoing | Copyright © 2019-2025 | 点击查看十年之约 | 鄂ICP备2024072800号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式