next up previous contents
Next: CVS is not ... Up: The CVS Solution Previous: The CVS Solution   Contents

The Basic Idea

Most of this material is a summary of the CVS documentation [7].

CVS is a version control system. You use it to record a history of changes to your source files. CVS will allow you to maintain a site that contains all of your code and a history of changes, called the repository. Repositories can be local or global. If the repository is global then developers worldwide can ``check code out''. Some are given write access and allowed to ``check code in''.

The basic cycle of code development using CVS involves:

  check out an initial copy of the repository into a local directory
  for each set of changes
      make the changes in your local directory
      check in the changes to the repository
      commit the changes

The concept of ``checking code out'' involves getting a local copy from the repository, usually of the latest code, but sometimes you might want a pre-change version. CVS can do this. This enables you to back up in time. Most frequently this is useful when you had a previous working version and some change you made has introduced a bug. It is then possible to walk backward thru the changes to find out which change actually caused the bug.

CVS only weakly supports this idea thru the admin command. Some versioning systems lock every file you check out. Locking a file means that no-one can modify the file while you have it checked out. Locking files may seem like a good idea as it eliminates the possibility of two people trying to modify the same file at the same time. Locking can cause problems if one developer checks out a set of files and then goes on vacation. This can bring development to a grinding halt. In lieu of locking files CVS will allow you to query the status of a file. We will talk about this later.

Changes that you make locally are done using your normal editor. The only special event is when you add or delete a file. If this happens you have to tell cvs using a command like:

  (create the file)
  cvs add (filename or directory)
or
  (delete the file)
  cvs delete (filename)
Note that you can't delete directories.

The concept of ``checking code in'' means that you have changed a file and you want to put the changes back into the general pile for others to see. The problem is what to do with the code that is already there. Various systems maintain fairly similar answers to this question but the details are important. When you check the code in you commit it. At that time other developers can see your changes and old copies of the file are hidden unless you explicitly request them.

CVS software is available free online [8].


next up previous contents
Next: CVS is not ... Up: The CVS Solution Previous: The CVS Solution   Contents
root 2004-02-24