fedora下安装Git

 


     最初GIT是由Linus为了更有效地管理Linux内核开发而创立的分布式版本控制软件,与常用的版本控制工具如CVS/SVN不同,它不必服务器端软件支持,速度和效率也有着相当程度的提高。
     如果拥有CVS或者SVN的使用背景,那么更熟悉的方法是客户端-服务器端模式,所有的文件仓库(repository)都是存放在服务器上的,用户需要在本地安装客户端去服务器上的项目中获取旧版本,提交新版本。
     GIT抛弃了这种模式,当用户从远端GIT仓库下载一个工程(project)时,这个工程的所有文件,包括版本历史,文件改动都会下载下来.此时,本地GIT就演变成了一个服务器,所有的提交(check-in)、提出(check-out)都会在这个本地服务器上执行。当确定一项修改之后,可以再和远端仓库进行合并和同步(merge)。所以,GIT的安装和配置步骤无论在本机还是服务器上都是完全一样的。
-------------------------------------------------------以上摘自网络--------------------------------------------------------
 

  Git的工作需要调用curl,zlib,openssl,expat,libiconv等库的代码,所以需要先安装这些依赖工具。

       #yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel


       在本地Fedora上可以直接通过yum自动安装之,但是版本较低。也可以通过下载源代码,手动安装。这里记录下(先手动,后面为手动):
------------------------------------------------------手动安装-------------------------------------------
1、首先获取git安装包:
      链接地址为:http://down1.chinaunix.net/distfiles/git-1.7.8.tar.gz


    [admin@localhost tar]$ axel http://down1.chinaunix.net/distfiles/git-1.7.8.tar.gz


2、解压:


    [admin@localhost tar]$ tar -vxzf git-1.7.8.tar.gz
    total 5328
    -rw-r--r-- 1 admin admin 31424 2011-12-31 12:53 a.vim
    -rw-r--r-- 1 admin admin 50704 2011-10-30 14:16 axel_2.4.orig.tar.gz
    -rw-r--r-- 1 admin admin 361214 2012-01-27 20:14 cscope-15.7a.tar.bz2
    -rw-r--r-- 1 admin admin 479927 2011-12-14 17:08 ctags-5.8.tar.gz
    -rw-r--r-- 1 admin admin 149333 2011-12-21 21:46 cvim.zip
    drwxrwxr-x 20 admin admin 20480 2012-03-08 00:02 git-1.7.8
    -rw-rw-r-- 1 admin admin 3538330 2012-03-07 23:56 git-1.7.8.tar.gz
    -rw-r--r-- 1 admin admin 693853 2011-11-22 23:41 nginx-1.1.7.tar.gz
    -rw-r--r-- 1 admin admin 50243 2011-12-20 22:09 taglist_45.zip
    -rw-r--r-- 1 admin admin 30831 2011-12-22 00:22 winmanager.tar.bz2
    [admin@localhost tar]$ 


3、安装,其中makeinstall 需要root权限:
 


    [admin@localhost tar]$ cd git-1.7.8
    [admin@localhost git-1.7.8]$./configure
    [admin@localhost git-1.7.8]$make
    [admin@localhost git-1.7.8]$make prefix = /usr  install 
   


4、查询安装后版本:


    [admin@localhost git-1.7.8]$ git --version
    git version 1.7.8


---------------------------------------------------自动安装,但版本较低--------------------------------------------
     
1、查询之:yum info git


    [root@localhost ~]# yum info git
    Loading "installonlyn" plugin
    Available Packages
    Name : git
    Arch : i386
    Version: 1.5.3.3
    Release: 3.fc7
    Size : 6.3 k
    Repo : updates
    Summary: Git core and tools
    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.
    This is a dummy package which brings in all subpackages.
      [root@localhost ~]#


2、安装之:yum -y install git
 


    [root@localhost ~]# yum install git
    Loading "installonlyn" plugin
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package git.i386 0:1.5.3.3-3.fc7 set to be updated
    -->.........................
    --> Running transaction check
    ---> Package cvsps.i386 0:2.1-4.fc6 set to be updated
    ---> Package perl-Error.noarch 1:0.17010-1.fc7 set to be updated
    ---> Package subversion-perl.i386 0:1.4.4-1.fc7 set to be updated
    ---> Package tk.i386 1:8.4.13-7.fc7 set to be updated
    ---> Package tla.i386 0:1.3.5-4.fc7 set to be updated
    --> Processing Dependency: libtcl8.4.so for package: tk
    --> Processing Dependency: tcl = 1:8.4.13 for package: tk
    --> Restarting Dependency Resolution with new changes.
    --> Running transaction check
    ---> Package tcl.i386 1:8.4.13-19.fc7 set to be updated
    Dependencies Resolved
    =============================================================================
    Package Arch Version Repository Size
    =============================================================================
    Installing:
    git i386 1.5.3.3-3.fc7 updates 6.3 k
    Installing for dependencies:
    cvsps i386 2.1-4.fc6 fedora 56 k
    git-arch i386 1.5.3.3-3.fc7 updates 25 k
    git-core i386 1.5.3.3-3.fc7 updates 4.5 M
    git-cvs i386 1.5.3.3-3.fc7 updates 64 k
    git-email i386 1.5.3.3-3.fc7 updates 21 k
    git-gui i386 1.5.3.3-3.fc7 updates 77 k
    git-svn i386 1.5.3.3-3.fc7 updates 76 k
    gitk i386 1.5.3.3-3.fc7 updates 64 k
    perl-Error noarch 1:0.17010-1.fc7 updates 27 k
    perl-Git i386 1.5.3.3-3.fc7 updates 15 k
    subversion-perl i386 1.4.4-1.fc7 updates 747 k
    tcl i386 1:8.4.13-19.fc7 updates 1.8 M
    tk i386 1:8.4.13-7.fc7 updates 1.2 M
    tla i386 1.3.5-4.fc7 updates 354 k
    Transaction Summary
    =============================================================================
    Install 15 Package(s)
    Update 0 Package(s)
    Remove 0 Package(s)
    Total download size: 9.0 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/15): git-core-1.5.3.3- 100% |=========================| 4.5 MB 02:10
 .........................................
    (15/15): cvsps-2.1-4.fc6. 100% |=========================| 56 kB 00:00
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Installing: tla ####################### [ 1/15]
    ................................
    Installing: git-gui ####################### [13/15]
    Installing: gitk ####################### [14/15]
    Installing: git ####################### [15/15]
    Installed: git.i386 0:1.5.3.3-3.fc7
    Dependency Installed: cvsps.i386 0:2.1-4.fc6 git-arch.i386 0:1.5.3.3-3.fc7 git-core.i386 0:1.5.3.3-3.fc7 git-cvs.i386 0:1.5.3.3-3.fc7 git-email.i386 0:1.5.3.3-3.fc7 git-gui.i386 0:1.5.3.3-3.fc7 git-svn.i386 0:1.5.3.3-3.fc7 gitk.i386 0:1.5.3.3-3.fc7 perl-Error.noarch 1:0.17010-1.fc7 perl-Git.i386 0:1.5.3.3-3.fc7 subversion-perl.i386 0:1.4.4-1.fc7 tcl.i386 1:8.4.13-19.fc7 tk.i386 1:8.4.13-7.fc7 tla.i386 0:1.3.5-4.fc7
    Complete!
    [root@localhost ~]#


 3、暗转后查询之:yum info git
 


    [root@localhost ~]# yum info git
    Loading "installonlyn" plugin
    Installed Packages
    Name : git
    Arch : i386
    Version: 1.5.3.3
    Release: 3.fc7
    Size : 0.0
    Repo : installed
    Summary: Git core and tools
    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.
    This is a dummy package which brings in all subpackages.


4、man之 and version
 


    [root@localhost ~]#
    [root@localhost ~]# man git
    GIT(7) Git Manual GIT(7)
    NAME
    git - the stupid content tracker
    SYNOPSIS
    git [--version] [--exec-path[=GIT_EXEC_PATH]]
    [-p|--paginate|--no-pager]
    [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
    [--help] COMMAND [ARGS]
    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.
    See this tutorial[1] to get started, then see Everyday Git[2] for a useful minimum set of commands, and "man
    git-commandname" for documentation of each command. CVS users may also want to read CVS migration[3]. See Git
    Users Manual[4] for a more in-depth introduction.
    The COMMAND is either a name of a Git command (see below) or an alias as defined in the configuration file (see
    git-config(1)).
    Formatted and hyperlinked version of the latest git documentation can be viewed at
    http://www.kernel.org/pub/software/scm/git/docs/.
    [root@localhost ~]# git --version
    git version 1.5.3.3
    [root@localhost ~]#


 
      git的具体用法在后续的应用中,逐步熟悉吧!
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值