CVS – A Basic Introduction

CVS – Getting Started

Use this document to get started using CVS. It contains a very short intro to CVS and points you to the more detailed installation and configuration procedures you must follow to use CVS from a Windows or Linux PC.

These instructions are written for developers who need CVS access for the first time.

A Brief Intro to CVS

CVS is short for Concurrent Versions System.

CVS is a widely used open source source-code control system. It operates using a client-server model. The source-code is stored in a CVS repository on the CVS server. You interact with the CVS repository by using a CVS client on your PC. You use CVS commands like checkout, update, and commit make your source-code changes locally and then communicate them back to the central CVS repository.

From a development point of view CVS is different from many other version-control tools in two key aspects.

First, when using CVS you normally work at a project level. Rather than checking out a single file, you checkout an entire project directory tree. For example, if you have a project that looks like this:

  \mystuff
    dirA\
      fileA1
      fileA2
    dirB\
      fileB1
      fileB2

And you know you need to change fileB1, rather than just checking out that single file, you checkout out the entire mystuff project. When you do this, CVS will create the mystuff project directory with all of its sub-directories and files on your PC. You can then make your changes, compile them, and test them. When you are done, you use one CVS commit command to submit your project changes back into CVS. CVS will detect every update you have made within the project, and will submit new versions of those files back into the repository.

Second, implicit in our discussion above is another key difference when using CVS. When you checkout source from CVS, it is not locked. CVS allows concurrent updates to be made to project code. At the same time that you are modifying fileB1 another developer can also be changing the same file. When you commit your changes back to the CVS repository, CVS will automatically merge all non-conflicting changes. If it finds any conflicting changes, CVS will notify you of the conflict and will not submit that file back to the repository until you have manually fixed the conflicting change(s).

One final important point to make about CVS – you never work directly within the CVS repository. Instead you check out projects to your own PC. By doing this you create private work areas (or ‘sandboxes’). Once you’ve got your sandbox, you can edit, compile and test completely isolated from changes being made to the CVS repository by other users. You can bring your sandbox up-to-date with the central repository at any time using the CVS update command. The timing and frequency of these updates is completely up to you and your project lead. Each time you complete a round of changes and reach a ‘turnover’ point, commit the entire project back into CVS and then begin work on the next round of changes.

To Learn More About CVS

If you are new to CVS, there is an almost overwhelming amount of information on the web. But the best place to start is with Karl Fogel’s book Open Source Development with CVS. Read the chapter called An Overview of CVS, especially the sections Basic Concepts and A Day With CVS.

The CVS manual, Version Management with CVS, also known as the Cederqvist is also available on-line. However, it is written much more as a reference manual than a tutorial.

Getting Started – Step by Step

  1. Your first step is to determine which of the CVS server you will be using, if you will be working on multiple projects, you may need access to more than one.If you will be working on an existing project, ask the project lead which CVS server is used to host that project.
  2. Install and configure an SSH client for secure access to the CVS repository.If you are using Windows, use these instructions:
    1. Installing the PuTTY SSH Client for Windows
    2. Configure SSH Keys
  3. If you are using Windows, use the Install CVS for Windows instructions to install the CVS command-line and gui clients on your PC. If you are using Linux, the CVS command-line client should have been installed by default.
  4. You are now ready to begin working with CVS.

Credits

This page is based on an internal page written by Bruce Files at MPCT (later Aleri) in Chicago. It has been modified to make it a generic guide suitable for publication on the internet.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.