如何安装linux7.3,centos 7.3 如何安装最新版 git

特意整了个 CentOS 7.3...

[root@icentos ~]# cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

# 默认源中的 git 版本是 1.8.3.1

[root@icentos~]# yum info git

...

Available Packages

Name : git

Arch : x86_64

Version : 1.8.3.1

Release : 20.el7

Size : 4.4 M

Repo : updates/7/x86_64

Summary : Fast Version Control System

URL : http://git-scm.com/

License : GPLv2

Description : Git is a fast, scalable, distributed revision control system with an

: unusually rich command set that provides both high-level operations

: and full access to internals.

:

: The git rpm installs the core tools with minimal dependencies. To

: install all git packages, including tools for integrating with other

: SCMs, install the git-all meta-package.

Red Hat Enterprise Linux, Oracle Linux, CentOS, Scientific Linux, et al.

RHEL and derivatives typically ship older versions of git. You can download a tarball and build from source, or use a 3rd-party repository such as the IUS Community Project to obtain a more recent version of git.

那么在 CentOS 7.3 里要安装最新版的 git, 通常可以这么做

# 使用旧版 git 下载最新版 git 源码到本地, 自行编译安装

git clone https://github.com/git/git

# 当然也可以下载官方提供的归档包, 自行编译安装

https://mirrors.edge.kernel.org/pub/software/scm/git/

# 亦或者可以使用三方仓库, 比如 IUS Community Project, 通常比较新, 但可能不是最最新

# 添加 IUS 源

yum install -y https://centos7.iuscommunity.org/ius-release.rpm

# IUS 源的软件名称一般会加上版本号和 u 字母

# 查看 git2u 版本

yum info git2u # 会发现比较新, 但不是最最新, 不过会比 yum 默认源要新很多

# 安装 git2u

yum install -y git2u

# 安装完成后, 再查看下版本咯

[root@icentos ~]# git version

git version 2.16.5

当然, 最后的最后, 如果你已经安装过旧版的 git, 需要先卸载才行

yum remove git

码完收工

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值