Chinaunix首页 | 论坛 | 博客
  • 博客访问: 314037
  • 博文数量: 60
  • 博客积分: 2781
  • 博客等级: 少校
  • 技术积分: 600
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-23 16:42
文章分类

全部博文(60)

文章存档

2011年(33)

2010年(27)

分类: LINUX

2011-03-22 10:56:20

安装软件有两种方法,一是直接下载特定于某个系统的已编译好的二进制安装包(比如apt-get install, yum install),另一个则是从源码安装。源码安装的好处是可以跟踪最新版本的软件,因为有的软件库可能未及时更新所有的软件包。

安装Git需要依赖的库有curl, zlib, openssl, perl,expat, asciidoc, xmlto等,可以查看源码目录下的INSTALL文件,里面对于依赖库有详细的描述(以下列举了开头部分):
  1. - Git is reasonably self-sufficient, but does depend on a few external
  2.    programs and libraries. Git can be used without most of them by adding
  3.    the approriate "NO_=YesPlease" to the make command line or
  4.    config.mak file.

  5.     - "zlib", the compression library. 。。。。以下省略若干条目
PS:在配置依赖包的时候可能需要新下载一些软件包,这是会发现同名软件包可能会有多个版本,我们应该选择哪一个安装呢,根据源码安装的特点,我们尽量选择-dev版本的,原因如下:
  1. Because compiling from sources is considered “development” work, the normal binary versions of installed libraries are not sufficient. Instead, you need the -dev versions because the development variants also supply header files required during compilation.

将所有依赖库配置妥当后,就可以进行安装了,以前博客中介绍了关于如何源码安装软件http://blog.chinaunix.net/space.php?uid=1721137&do=blog&id=85144,这次又加深了理解,不错不错,勤动手勤思考。哈哈。下面是安装步骤:

  1. /×
  2. * 将Git安装到 home directory
  3. ×/

  4. $> cd git-1.7.4
  5. $> ./configure
  6. $> make all doc
  7. #> make install install-doc  // use root

  1. /*
  2. * 将Git安装到指定位置 /usr
  3. */

  4. $> cd git-1.7.4
  5. $> ./configure --prefix=/usr
  6. $> make all doc
  7. #> make install install-doc  // use root
等待Git成功安装后,就可以继续下一步Git的配置工作,请参考链接:


当Git配置完成后,就可以大肆地Git了,但是在Linux状态下,git是通过命令行来进行工作的,网上有个关于常用命令的参考,大家可以查看链接:


为了图文并茂,上图一张。。。

最后祝大家Git愉快!~
阅读(2880) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~