3.版本库

Posted on Posted in 3.基本概念

本章修改自《使用 Subversion 进行版本管理》的相同章节,它的在线版本位于: http://svnbook.red-bean.com/

这一章是对 Subversion 一个简短随意的介绍,如果你对版本控制很陌生,这一章节完全是为你准备的,我们从讨论基本概念开始,深入理解 Subversion 的思想,然后展示许多简单的实例。

尽管我们的例子展示了人们如何分享程序源代码,仍然要记住 Subversion 可以控制所有类型的文件-它并没有限制只为程序员工作。

版本库

Subversion 是一种集中的分享信息的系统,它的核心是版本库,储存所有的数据,版本库按照文件树形式储存数据-包括文件和目录,任意数量的客户端可以连接到版本库,读写这些文件。通过写数据,别人可以看到这些信息;通过读数据,可以看到别人的修改。

图 2.1. 一个典型的客户/服务器系统

一个典型的客户/服务器系统

所以为什么这很有趣呢?讲了这么多,让人感觉这是一种普通的文件服务器,但实际上,版本库另一种文件服务器,而不是你常见的那一种。最特别的是 Subversion 会记录每一次的更改,不仅针对文件也包括目录本身,包括增加、删除和重新组织文件和目录。

When
 a client reads data from the repository, it normally sees only the
 latest version of the filesystem tree. But the client also has the
 ability to view previous states of the filesystem. For
example, a client can ask historical questions like, “what did this
directory contain last Wednesday?”, or “who was the last person to
change this file, and what changes did they make?” These are the sorts
of questions that are at the heart of any version control system: systems that are designed to record and track changes to data over time.