Introduction

Modern version control systems store changes to filesystem trees, preserving change history and allowing changes to be rolled back if required. They facilitate teamwork, allowing people to work in parallel on project documents, distributing and merging changes and helping to resolve change conflicts. With a version control system, multiple copies of files in different states become a thing of the past. If you want to know what a file was like at some point in the past you just ask the system.

Early version control systems like SCCS and RCS just manage files. CVS is aware of directories, but can't version them. Subversion, the successor to CVS, manages versioned filesystem trees, both files and directory structure. It has become the most popular version control system for open source project development.

Main Features

  • Subversion manages versioned filesystem trees. Subversion commands generally behave recursively, operating on the current subtree unless restricted.
  • Directories, files, symbolic links and file metadata are versioned. This covers creation, deletion, editing, renaming and restructuring, but not rw permissions or ownership except through metadata.
  • Versions are stored in a central repository. Version numbers identify the state of the repository, not the state of individual files stored in it.
  • Repositories are accessed with Subversion tools, directly on the local filesystem including NFS mounts, or over a network using authenticated client-server communications.
  • Work is done in a working copy of all or part of a repository tree. A .svn subdirectory in each working copy directory contains pristine copies of files to reduce repository communications.
  • Repository commits are atomic; either all changes are recorded, or none in the case of error.
  • Files are stored differentially in the repository, using the xdelta differencing algorithm which treats all files as binary. The preferred repository format is file-based, where each version occupies a file.

Subversion Tools

  • svn: Command-line client program.
  • svnlook: Tool for directly inspecting a Subversion repository.
  • svnadmin: Tool for creating, tweaking or repairing a Subversion repository.
  • svndumpfilter: Filters Subversion repository dump streams.
  • svnversion: Reports the state of a working copy.
  • svnsync: Incrementally mirrors one repository to another over a network.
  • svnserve: Alternative server program to Apache.
  • WebSVN, WebVC: Web clients.

Online Help

Subversion command-line tools offer detailed help. For example, do

$ svn help
for a list of svn command names, and
$ svn help command
for help on a particular command.

For further information refer to the Subversion web site and the comprehensive ebook and the FAQ there.

This Tutorial

This tutorial covers most Subversion features needed for normal use. It assumes you are running Linux, and uses short forms of common command names. In the command-line examples, commands you would type in a terminal are prefixed with $ following convention. Any command output follows, and is the actual output you should see if you replay the examples. It is captured by executing the commands when this document is generated from xml source.

This is work-in-progress. It doesn't yet deal with branching and merging, use of hook scripts, etc. Suggestions for additions and changes to John Storrs please.