在RHEL-5.5上安装Git-1.7.2

  • 先检查下版本信息:

  • [@sohu_99_3 ~]#  lsb_release -a
    LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
    Distributor ID: RedHatEnterpriseServer
    Description:    Red Hat Enterprise Linux Server release 5.5 (Tikanga)
    Release:        5.5
    Codename:       Tikanga


    [@sohu_99_3 ~]# uname -a         
    Linux sohu_99_3 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux


    [@sohu_99_3 ~]# cat /proc/version
    Linux version 2.6.18-194.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:39 EDT 2010

  • 因为编译安装,所以先安装相应的devel包:
  •     yum install zlib-devel
        yum install gettext-devel
        yum install openssl-devel
        yum install curl-devel 
        yum install expat-devel
     
  • 下载解压缩git:
  •    wget http://kernel.org/pub/software/scm/git/git-1.7.2.tar.gz

       tar -xzvf git-1.7.2.tar.gz
  • 编译安装:
  •      cd git-1.7.2

         make prefix=/usr/local all

         make prefix=/usr/local install
  • 检查一下:
  •     安装好的文件:
        [@sohu_99_3 ~]# ll /usr/local/bin/
    total 17948
    -rwxr-xr-x 105 root root 4623648 Aug 12 09:40 git
    -rwxr-xr-x   1 root root  120943 Aug 12 09:40 git-cvsserver
    -rwxr-xr-x   1 root root  321995 Aug 12 09:40 gitk
    -rwxr-xr-x   1 root root 4623648 Aug 12 09:40 git-receive-pack
    -rwxr-xr-x   1 root root 1926258 Aug 12 09:40 git-shell
    -rwxr-xr-x   1 root root 4623648 Aug 12 09:40 git-upload-archive
    -rwxr-xr-x   1 root root 1970204 Aug 12 09:40 git-upload-pack
    -rwxr-xr-x   1 root root    1576 Aug 10 10:58 pcre-config
    -rwxr-xr-x   1 root root   35248 Aug 10 10:58 pcregrep
    -rwxr-xr-x   1 root root   54467 Aug 10 10:58 pcretest

       git命令的执行:
    [@sohu_99_3 ~]# git
    usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
               [-p|--paginate|--no-pager] [--no-replace-objects]
               [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
               [-c name=value
               [--help] COMMAND [ARGS]

    The most commonly used git commands are:
       add        Add file contents to the index
       bisect     Find by binary search the change that introduced a bug
       branch     List, create, or delete branches
       checkout   Checkout a branch or paths to the working tree
       clone      Clone a repository into a new directory
       commit     Record changes to the repository
       diff       Show changes between commits, commit and working tree, etc
       fetch      Download objects and refs from another repository
       grep       Print lines matching a pattern
       init       Create an empty git repository or reinitialize an existing one
       log        Show commit logs
       merge      Join two or more development histories together
       mv         Move or rename a file, a directory, or a symlink
       pull       Fetch from and merge with another repository or a local branch
       push       Update remote refs along with associated objects
       rebase     Forward-port local commits to the updated upstream head
       reset      Reset current HEAD to the specified state
       rm         Remove files from the working tree and from the index
       show       Show various types of objects
       status     Show the working tree status
       tag        Create, list, delete or verify a tag object signed with GPG

    See 'git help COMMAND' for more information on a specific command.
      
       从github上获取项目:
       [@sohu_99_3 mochi]# git clone http://github.com/mochi/mochiweb.git
    Cloning into mochiweb...
    remote: Counting objects: 921, done.
    remote: Compressing objects: 100% (326/326), done.
    remote: Total 921 (delta 638), reused 813 (delta 575)
    Receiving objects: 100% (921/921), 182.37 KiB | 24 KiB/s, done.
    Resolving deltas: 100% (638/638), done.

猜你喜欢

转载自mabei.iteye.com/blog/735168