今天是“
git
第一天”,和我“从零开始”吧!
1.
我用命令
rpm -qa|grep
-
i git
查看一下我的机器是否安装了
git
:
[rocrocket@yhh ~]$ sudo su -
[root@wyhh ~]# rpm -qa|grep -i git
libcapseo-0.2.0-0.1.20080603gita6ec446.fc9.i386
libcaptury-0.3.0-0.1.20080323gitcca4e3c.fc9.i386
xorg-x11-drv-nouveau-0.0.10-2.20080408git0991281.fc9.i386
xorg-x11-drv-digitaledge-1.1.1-1.fc9.i386
此处
grep
命令使用
-i
是表示不区分大小写,这样的话无论是大写小写的
git/GIT/GiT…
都不会逃过
grep
的法眼。
结果发现了一些似乎使用
git
管理的开发项目,还有一些包含
git
字符的其他包,但就是没发现
git
包。看来我需要安装
一个!
2.如果使用 fedora 的 yum 来安装 git,应该是相当简单。如果你是 ubuntu,那就更简单了,用 apt-get 就可以。如果是gentoo 的话,我想可以用 emerge 吧。源码安装的话,大家可以参考
git官网看看。我当然毫无悬念的选择 yum:
[root@yhh ~]# yum list|grep ^git
git.i386 1.5.5.1-1.fc9 updates-newkey
git-all.i386 1.5.5.1-1.fc9 updates-newkey
git-arch.i386 1.5.5.1-1.fc9 updates-newkey
git-cvs.i386 1.5.5.1-1.fc9 updates-newkey
git-daemon.i386 1.5.5.1-1.fc9 updates-newkey
git-email.i386 1.5.5.1-1.fc9 updates-newkey
git-gui.i386 1.5.5.1-1.fc9 updates-newkey
git-svn.i386 1.5.5.1-1.fc9 updates-newkey
gitk.i386 1.5.5.1-1.fc9 updates-newkey
gitweb.i386 1.5.5.1-1.fc9 updates-newkey
此处的
grep
命令使用了
^
符号,表示后面的字符串需要在每行的最开头位置,于是我们得到了如上的一大串
git
软件包。
首先我能肯定的
git.i386
是必然需要安装的,它一定是
git
的主包,但诸如
all
、
arch
、
cvs
等等这些包到底是起什么作用呢?
我有些迷惑了。于是,不得不求助
baidu
了。
原来:
git
包是
git
的核心程序,它只包括最小的依赖关系,如果只安装
git
包的话,那么一些
git
的外围扩展将无法使用。
git-all
包包括了所有的集成在
git
上的外围扩展功能。安装了这个包,你就万事大吉了!
git-arch
包是为了兼容
arch
仓库的。大家或许听说过
linux
的发行版本
arch
,但现在说的
arch
和这个发行版本似乎没有必然关系。git-arch
中的
arch
是
gnu arch
,它是一个类似于
cvs
、
sccs
、
svn
的版本控制系统。
git-arch
包用于支持从
gnuarch 仓库导入到
git
仓库。
git-cvs
包用于支持从
cvs
仓库导入到
git
仓库。
git-daemon
包用于支持用户使用
git://
形式的命令来访问
git
仓库。
git-email
包支持使用
git
发送邮件。(这个功能用处在哪里呢?我也不太清楚。慢慢研究中… 如果哪位朋友会,在下面留个言)
git-gui
包是一个基于
Tk
的
git
程序,也就是说是带有
GUI
的,可以用鼠标点击操作的
git
。
git-svn
包用于支持从
svn
仓库导入到
git
仓库。
gitk
包是一个带有
Tcl/Tk GUI
的可以用来浏览
git
仓库历史信息的桌面程序。(如果你对
git
仓库这个词没有概念的话,不要急,后面会说到。现在我们的目的就是要把 git
安装上。)
gitweb
包则是一个成熟的基于
web
的用于
git
仓库管理的
web
程序。
3.知道了每一个包的作用后,我们就来安装吧!
[root@yhh ~]# yum install git-all.i386
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
git-all i386 1.5.5.1-1.fc9 updates-newkey 9.0 k
Installing for dependencies:
cvsps i386 2.1-6.fc9 fedora 55 k
emacs-common i386 1:22.2-5.fc9 updates-newkey 19 M
emacs-git i386 1.5.5.1-1.fc9 updates-newkey 53 k
git i386 1.5.5.1-1.fc9 updates-newkey 3.5 M
git-arch i386 1.5.5.1-1.fc9 updates-newkey 28 k
git-cvs i386 1.5.5.1-1.fc9 updates-newkey 69 k
git-email i386 1.5.5.1-1.fc9 updates-newkey 28 k
git-gui i386 1.5.5.1-1.fc9 updates-newkey 177 k
git-svn i386 1.5.5.1-1.fc9 updates-newkey 71 k
gitk i386 1.5.5.1-1.fc9 updates-newkey 79 k
perl-Error noarch 1:0.17012-2.fc9 fedora 27 k