Go to the first, previous, next, last section, table of contents.

Concepts of Version Control

When a file is under version control, we also say that it is registered in the version control system. Each registered file has a corresponding master file which represents the file's present state plus its change history, so that you can reconstruct from it either the current version or any specified earlier version. Usually the master file also records a log entry for each version describing what was changed in that version.

The file that is maintained under version control is sometimes called the work file corresponding to its master file.

To examine a file, you check it out. This extracts a version of the source file (typically, the most recent) from the master file. If you want to edit the file, you must check it out locked. Only one user can do this at a time for any given source file. (This kind of locking is completely unrelated to the locking that Emacs uses to detect simultaneous editing of a file.)

When you are done with your editing, you must check in the new version. This records the new version in the master file, and unlocks the source file so that other people can lock it and thus modify it.

Checkin and checkout are the basic operations of version control. You can do both of them with a single Emacs command: C-x C-q (vc-toggle-read-only).

There are variants of this basic pattern, though. CVS, for example, has no such thing as locking, and therefore you can normally edit files right away, without having to check them out first. See section Using VC with CVS. With RCS, you can optionally select non-strict locking for a particular source file; then you can edit the file in Emacs without explicitly locking it.

A snapshot is a coherent collection of versions of the various files that make up a program. See section Snapshots.


Go to the first, previous, next, last section, table of contents.