Next: , Up: Secondary VC Commands


23.7.5.1 Registering a File for Version Control

You can put any file under version control by simply visiting it, and then typing C-x v i (vc-register).

C-x v i
Register the visited file for version control.

To register the file, Emacs must choose which version control system to use for it. If the file's directory already contains files registered in a version control system, Emacs uses that system. If there is more than one system in use for a directory, Emacs uses the one that appears first in vc-handled-backends (see Customizing VC). On the other hand, if there are no files already registered, Emacs uses the first system from vc-handled-backends that could register the file (for example, you cannot register a file under CVS if its directory is not already part of a CVS tree); with the default value of vc-handled-backends, this means that Emacs uses RCS in this situation.

If locking is in use, C-x v i leaves the file unlocked and read-only. Type C-x v v if you wish to start editing it. After registering a file with CVS, you must subsequently commit the initial version by typing C-x v v. Until you do that, the version appears as ‘@@’ in the mode line.

The initial version number for a newly registered file is 1.1, by default. You can specify a different default by setting the variable vc-default-init-version, or you can give C-x v i a numeric argument; then it reads the initial version number for this particular file using the minibuffer.

If vc-initial-comment is non-nil, C-x v i reads an initial comment to describe the purpose of this source file. Reading the initial comment works like reading a log entry (see Log Buffer).