zoukankan      html  css  js  c++  java
  • 在CentOS上安装Git

    CentOS 5的yum源中没有git,只能自己编译安装,现记录下编译安装的内容及错误解决方法,留给自己备忘。
    编译基础环境环境

    yum -y install gcc make

     
    确保已安装了依赖的包

    yum install -y curl curl-devel zlib-devel openssl-devel perl perl-devel cpio expat-devel gettext-devel

     
    下载最新的git包

    wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
    tar xzvf git-latest.tar.gz
    cd git-2012-07-05 #你的目录可能不是这个
    autoconf
    ./configure
    make && make install

     
    检查下安装的版本,大功告成

    [root@cobbler git-2012-07-05]# git --version
    git version 1.7.11.GIT
     
    编译时遇到错误讯息及解决方法:
    make[1]: Warning: File `Makefile' has modification time 3e+06 s in the future
    /usr/bin/perl Makefile.PL PREFIX='/usr/local' INSTALL_BASE='' --localedir='/usr/local/share/locale'
    Writing perl.mak for Git
    make[1]: warning:  Clock skew detected.  Your build may be incomplete.
        GEN git-add--interactive
    make[1]: Warning: File `Makefile' has modification time 3e+06 s in the future
    Writing perl.mak for Git
    make[2]: Warning: File `Makefile.PL' has modification time 3e+06 s in the future
    Use of uninitialized value $localedir in concatenation (.) or string at Makefile.PL line 52.
    Writing perl.mak for Git
    make[2]: *** [perl.mak] Error 1
    make[1]: *** [instlibdir] Error 2
    make: *** [git-add--interactive] Error 2
    
    在网上搜索了一些,根据出错的warning发现是机器时间设置的问题。。是机器系统的时间比版本的时间早。所以要系统时间重新设置。
    

     
     
    由于CentOS6中yum源中已经有git的版本了,可以直接使用yum源进行安装

    yum -y install git

    目前yum源中的git版本如下
    [root@cobbler ~]# git --version
    git version 1.7.1

     
  • 相关阅读:
    Network In Network
    UNIX环境高级编程之第4章:文件和文件夹-习题
    SqlServer 错误日志切换和查看
    hihoCoder
    Mono源码学习笔记:Console类(四)
    Java transientkeyword使用小记
    高速排序算法具体解释与实现
    The Triangle
    iOS开发实践之GET和POST请求
    C#重构经典全面汇总
  • 原文地址:https://www.cnblogs.com/flypiggy/p/3198206.html
Copyright © 2011-2022 走看看