1.首先查看下当前的版本

[root@localhost ~]# git --version
git version 1.8.2.1

2.尝试进行升级

[root@localhost ~]# yum update git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirrors.aliyun.com
* base: mirrors.aliyun.com
* epel: mirrors.opencas.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Setting up Update Process
No Packages marked for Update

吐槽下,先尝试处理下,发现升级失败。

首先要卸载掉之前安装的git , yum  remove git

然后按照下面的链接来处理

3.https://www.howtoforge.com/how-to-install-the-latest-git-version-on-centos

1)切换到src目录下
cd /usr/src
2)获取git的源代码
wget https://www.kernel.org/pub/software/scm/git/git-2.0.1.tar.gz
3)解压
tar xzf git-2.0.1.tar.gz

The latest Git version at this time is 2.0.1. To find the latest available version when you follow this guide,

go to this URL https://www.kernel.org/pub/software/scm/git/ and search for the git-VERSION.tar.gz with the highest version number.

ps:2015年10月18日看到的最新版本是2.6.2

[root@localhost src]# wget https://www.kernel.org/pub/software/scm/git/git-2.6.2.tar.gz
--2015-10-18 21:21:50-- https://www.kernel.org/pub/software/scm/git/git-2.6.2.tar.gz
Resolving www.kernel.org... 198.145.20.140, 199.204.44.194, 149.20.4.69, ...
Connecting to www.kernel.org|198.145.20.140|:443... connected.
ERROR: cannot verify www.kernel.org's certificate, issued by `/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA':
Unable to locally verify the issuer's authority.
To connect to www.kernel.org insecurely, use `--no-check-certificate'.
Unable to establish SSL connection.

[root@localhost src]# wget --no-check-certificate https://www.kernel.org/pub/software/scm/git/git-2.6.2.tar.gz
--2015-10-18 21:27:03-- https://www.kernel.org/pub/software/scm/git/git-2.6.2.tar.gz
Resolving www.kernel.org... 198.145.20.140, 199.204.44.194, 149.20.4.69, ...
Connecting to www.kernel.org|198.145.20.140|:443... connected.
WARNING: cannot verify www.kernel.org's certificate, issued by `/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA':
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: 5535091 (5.3M) [application/x-gzip]
Saving to: `git-2.6.2.tar.gz'

100%[===================================================================================================================================================================================================>] 5,535,091 69.7K/s in 4m 36s

2015-10-18 21:31:40 (19.6 KB/s) - `git-2.6.2.tar.gz' saved [5535091/5535091]

You have mail in /var/spool/mail/root

mail的信息查看

[root@localhost src]# cat /var/spool/mail/root
From root@localhost.localdomain Sun Oct 18 21:26:17 2015
Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id t9IDQHpi007150
for <root@localhost.localdomain>; Sun, 18 Oct 2015 21:26:17 +0800
Received: (from root@localhost)
by localhost.localdomain (8.13.8/8.13.8/Submit) id t9IDQHOY006874;
Sun, 18 Oct 2015 21:26:17 +0800
Date: Sun, 18 Oct 2015 21:26:17 +0800
Message-Id: <201510181326.t9IDQHOY006874@localhost.localdomain>
To: root@localhost.localdomain
From: logwatch@localhost.localdomain
Subject: Logwatch for localhost.localdomain (Linux)
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="iso-8859-1"

################### Logwatch 7.3 (03/24/06) ####################
Processing Initiated: Sun Oct 18 21:26:17 2015
Date Range Processed: yesterday
( 2015-Oct-17 )
Period is day.
Detail Level of Output: 0
Type of Output: unformatted
Logfiles for Host: localhost.localdomain
##################################################################

--------------------- Selinux Audit Begin ------------------------

Number of audit daemon stops: 2

---------------------- Selinux Audit End -------------------------

--------------------- Automount Begin ------------------------

**Unmatched Entries**
lookup_read_master: lookup(nisplus): couldn't locate nis+ table auto.master: 1 Time(s)

---------------------- Automount End -------------------------

--------------------- Kernel Begin ------------------------

WARNING: Kernel Errors Present
hdc: drive_cmd: error=0x04 { AbortedCo ...: 1 Time(s)
hdc: drive_cmd: status=0x51 { DriveReady SeekComplete Error } ...: 1 Time(s)

---------------------- Kernel End -------------------------

--------------------- Connections (secure-log) Begin ------------------------

Userhelper executed applications:
root -> system-config-display as root: 1 Time(s)

---------------------- Connections (secure-log) End -------------------------

--------------------- Smartd Begin ------------------------

**Unmatched Entries**
Problem creating device name scan list
Device: /dev/hda, lacks SMART capability
Device: /dev/hda, to proceed anyway, use '-T permissive' Directive.
Device: /dev/hdc, not ATA, no IDENTIFY DEVICE Structure

---------------------- Smartd End -------------------------

--------------------- SSHD Begin ------------------------

SSHD Killed: 2 Time(s)

SSHD Started: 1 Time(s)

---------------------- SSHD End -------------------------

--------------------- Disk Space Begin ------------------------

Filesystem Size Used Avail Use% Mounted on
/dev/hda1 28G 3.6G 23G 14% /

---------------------- Disk Space End -------------------------

###################### Logwatch End #########################

[root@localhost src]# cd git-2.6.2

再执行下面的命令

make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

最后再git --version

CentOS升级git的更多相关文章

  1. [Linux] 低版本centos升级git解决fatal: HTTP request failed

    编译用的一些依赖yum install curl-devel expat-devel gettext-devel openssl-devel zlib-develyum install gcc per ...

  2. Centos7升级Git版本

    centos 升级 Git 版本 问题描述 centos7 系统默认的 git 安装版本是 1.8,但是在项目构建中发现 git 版本过低,于是用源码编译的方式进行升级.同时该文章也适用于安装新的 g ...

  3. CentOS自行编译升级Git

    上一篇升级Git的方式是通过更改yum的源,然后通过yum来安装,那么对于喜欢折腾的人来说,怎么通过Git的源代码自行安装呢? 我安装的是CentOS-7-x86_64-1908,自带的git是1.8 ...

  4. CentOS7 如何升级Git

    CentOS7自带的git版本1.8.3.1,这个版本有点低了.于是决定折腾升级,我首先想到的是用update更新: yum update git 结果,事与原违,还是1.8.3.1.在网上提供的升级 ...

  5. 阿里云ECS服务器(ubuntu)下基本配置以及升级git

    最近需要在阿里云服务器上远程搭建调试环境,这里把遇到的问题做一下记录: 1.ECS Linux解决SSH会话连接超时问题 用SSH客户端(我使用的Xshell)连接linux服务器时,经常会出现与服务 ...

  6. 在CentOS搭建Git服务器 转

    在CentOS搭建Git服务器 来自 :http://www.jianshu.com/p/69ea5ded3ede 前言 我们可以GitHub发布一些开源代码的公共仓库,但对于私密仓库就需要收费了.公 ...

  7. Centos 升级MySQL版本或者Yum安装Mysql5.6

    Centos 升级MySQL版本或者Yum安装Mysql5.6 1.从MySQL Yum仓库下载最新的rpm文件:http://dev.mysql.com/downloads/repo/yum/Cen ...

  8. CentOS搭建Git服务器及权限管理

    声明:本教程,仅作为配置的记录,细节不展开,需要您有一点linux的命令基础,仅作为配置参考. 1. 系统环境 系统: Linux:CentOS 7.2 64位 由于CentOS已经内置了OpenSS ...

  9. CentOS升级Svn到最新版

    CentOS升级Svn到最新版(金庆的专栏)CentOS/RHEL yum 安装的 subversion 是 1.6.11 版本,连VisulaSVN服务器时会有"Key usage vio ...

随机推荐

  1. mac安装memcache

    1.wget http://blog.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz 2.tar zxvf memcache-2.2 ...

  2. Spark Streaming揭秘 Day21 动态Batch size实现初探(下)

    Spark Streaming揭秘 Day21 动态Batch size实现初探(下) 接昨天的描述,今天继续解析动态Batch size调整的实现. 算法 动态调整采用了Fix-point迭代算法, ...

  3. 【生活】已经从官网购买iPad,单独购买AppleCare+服务

    1 什么是AppleCare+服务 从苹果官网购买的硬件产品如ipad.iphone和MacBook等,官网承诺的保修期限是一年.AppleCare+是水果公司推出的一种保修服务,最大的特点就是将保修 ...

  4. Linux 启动直接进入 console,

    我的电脑上有两块显卡,上次fedora更新后,自动安装了nvidia的驱动, 然后悲剧发生了.再也不能够正常进行图形界面了.所以需要进入CONSOLE. 1. 当系统启动时,停止grub menu自动 ...

  5. 查看某一个点是否在某个多边形内 使用ST_Contains函数

    查看某一个点是否在某个多边形内  使用ST_Contains函数 --LINESTRING ( 121.312350 30.971457 , 121.156783 31.092221 , 121.35 ...

  6. 【linQ】DataContext 入门 , 和 hql , jpql 一样好用

    DataContext 和 LINQ结合后会有巨大的能量 public class UserDataContext : DataContext { public Table<User> U ...

  7. 权限管理数据库设计_Rev1

    贴出来自身接触项目以来所接触过的一些企业管理信息系统权限部门的一个通用数据库设计初稿: 设计的文字解释以及各部分的作用等确定可行会再进行描述: 图: 如果有不同意见请轻拍!

  8. 两年的坚持,最后还是决定将ISoft开源

    还记得2011年9月份,我在上大四,本来想着考研能上个好点的学校,可我怎么就不愿去自习室上自习.每天晚上睡觉前都告诉自己明天早晨一定早起去上自习,但又每次醒来都不想起床啊,懒,没办法.睡到不想再睡了才 ...

  9. cocos2dx游戏资源加密之XXTEA

    在手机游戏当中,游戏的资源加密保护是一件很重要的事情. 我花了两天的时间整理了自己在游戏当中的资源加密问题,实现了跨平台的资源流加密,这个都是巨人的肩膀之上的. 大概的思路是这样的,游戏资源通过XXT ...

  10. WinForm控件选择器

    jQuery和Css的控件选择器用起来非常畅快,相信用过的人都会有这种感觉,而WinForm则是通过Name来实现窗体中控件的选择,在选择单个控件的时候是很方便,但是当选择具有一类特征的控件时,则显得 ...