*banner
 

Software Development
FAQ
CVS
Previous section  |  This section  |  Next section
Previous question  |  This question  |  Next question

Getting Started With CVS
Christopher Brooks, 17 Nov 2010
Last updated: 17 Nov 2010

Copied from John Reekie's CVS Page.

See also Subversion On Departmental Server: The instructions for setting up Subversion to allow one user to safely store revisions of papers and software on a departmental file server that is backed up.

Getting started with CVS

Some simple exercises to get things going. This worked for me on Solaris. For Windows, it should be basically the same if you install the Cyclic Software CVS binaries.

Add this to .cshrc and source it:

  setenv CVSROOT ~/Repository

When I tried it on Windows, the Windows version of CVS seems to assume that the Windows machine is running as a CVS client to a remote server. To have it run the server locally, set CVSROOT in the System control panel to eg:
  :local:c:usersjohnrRepository

Create the CVS repository

  cvs init
Create a new directory tree:
  cd ~/java
  mkdir diva
  mkdir diva/canvas
  mkdir diva/kernel
Import the new directory into CVS:
  cd diva
  cvs import -m "Created directory" diva local start
Get a working version of the new directory structure:
  cd ..
  mv diva diva.orig
  cvs checkout diva
Tell CVS to set permissions so that files are read-only until a "cvs edit" is performed on them:
  cvs watch on diva

Create a new source file in diva/canvas. Here's a sample:
// A simple Java file
// $Header: /home/johnr/cvs/eecs.berkeley.edu/info/cvs.html,v 1.1.1.1 1998/07/20 21:42:55 johnr Exp $
class Foo {
    public static void main(String[] argv) {
        System.out.println("Foo!");
    }
}
Add the file to CVS:
  cd ~/java/diva/canvas
  cvs add Foo.java
  cvs commit Foo.java
  chmod 444 Foo.java
Check out the file for editing:
  cvs edit Foo.java
Check the file back in:
  cvs commit Foo.java
Previous section  |  This section  |  Next section
Previous question  |  This question  |  Next question
©2002-2018 Chess