How to Collaborate Via CVS Repository



A. OVERVIEW

The following notes shows how to collaborate (say, in writing a paper) via a remote CVS repository.

For security reasons, we need to use SSH to access the CVS directory. Each collaborator (henceforth called "user") must use public-key encryption. Henceforth, the administrator at NYU is called "we".

For our example below, the remote CVS repository is at "access.cims.nyu.edu". You, the user, will have the user name of "e-friend" or "exact".

What is the difference between "exact" and "e-friend"? The e-friend account only has permission to access our CVS files. The exact account is meant for internal use, and has more permissions, to do things like ssh or sftp.


B. HOW TO JOIN THE SYSTEM


Before a user can get access to our CVS repository, he/she must take the following steps to create a private-public key pair in the OpenSSH format, and send us the public part.


C. SETTING UP ENVIRONMENTAL VARIABLES


The behaviour of CVS is dependent on values of certain environmental variables.
In these examples, we assume that your account is "e-friend". So if your account is "exact", you must replace all occurences of "e-friend" by "exact".
Two environmental variables CVS_RSH and CVSROOT must be set up first. For example, in bash shell:
        > export CVS_RSH=ssh
        > export CVSROOT=:ext:e-friend@access.cims.nyu.edu:/home/exact/cvsroot
For csh or tcsh shells, the corresponding commands are:
	> setenv CVS_RSH "ssh"
	> setenv CVSROOT ":ext:e-friend@access.cims.nyu.edu:/home/exact/cvsroot"
We suggest putting these into your startup shell script (e.g., .bashrc for bash).


D. HOW TO USE CVS: CHECKOUT AND UPDATE MODULES


After the above steps, you are ready to use our cvs. Suppose someone has already set up a "module" in cvs. Each module has a name (which is just a directory path).

E.g., 2004/FirstPaper, 2004/SecondPaper, 2004/FirstPaper/Abstract, 2004/FirstPaper/Conference, 2004/FirstPaper/Journal, etc.

Let us say that the module name is "ourPaper". Typically, you do these steps:

  1. You first go to your local directory where you like to store the directory "ourPaper". E.g., if the directory is "allPapers", then
    	> cd ~/allPapers
    
  2. Then you checkout "ourPaper":
    	> cvs co allPapers  
    
    This creates the directory "allPapers" together with any subdirectory and files.
  3. Now you can edit any file or add files to ourPaper. Skip this if you are familiar with using cvs. Say the file you modified is called "p.tex". To put your changes back into CVS, you typically take 3 actions:
    	> cvs diff p.tex	-- this shows any differences between
    				your version and the corresponding
    				version in cvs (there may be more recent
    				versions, but diff will not show them).  
    				You can edit your version of p.tex based
    				on this information.
    
    	> cvs update p.tex	-- to merge what is in the directory with
    				what is in your local version.
    				If there are any conflicts, these will
    				be marked between the lines marked by
    				<<<<<< and >>>>>>.  E.g.,
    
    				<<<<<<< fileName.tex =======
    				...cvs version
    				======
    				...your local version
    				>>>>>>> version number
    
    				You should resolve the conflict (typically,
    				by deleting your version or the cvs version).
    				Remove the marker lines with <<<< or >>>> too.
    				
    	> cvs commit p.tex	-- this updates CVS so that your local p.tex
    				is also the latest version of p.tex.
    
    
To summarize: to work on any file, you need to Hope this will get you started.

E. HOW TO CREATE NEW MODULES IN CVS


Suppose you want to create a new module named "2004/thirdPaper".

F. HOW TO USE TAGS and VERSIONS


Often you want to create a snapshot of your module at a given moment in time. E.g., after you submitted a paper to the journal, you want to tag the current version as "SUBMITTED". Subsequently, you can checkout this particular version under the tag "SUBMITTED".

The issues of tagging is complicated by the existence of tags for branches. But here, we give instructions for the simplest use of tags, where you just want a copy frozen in time. So you are not allowed to check in any changes to the "SUBMITTED" version. CVS calls such "SUBMITTED" a sticky tag (also known as a pure tag).

There are three basic commands to learn: how to create a tag, how to checkout a tagged version, and how to find the available tags.

Tagging is meant for all the files in a module. But each individual file has its own automatic tag, called version number. Here are some ways to use version numbers:


Let send us your feedback to improve these instructions! --Chee