Cvs Tutorial

Some on-line ConcurrentVersionsSystem tutorials:

Per Cederqvist's manual
AKA TheCederqvist http://www.cvshome.org/docs/manual/

Open Source Development with CVS by Karl Fogel (ISBN 1-57610-490-7 (Orig.); latest edition is ISBN 1932111204 )
AKA CvsBook http://cvsbook.red-bean.com/cvsbook.html.

Frankly, if you're looking for a CVS tutorial/reference/bible you can't do much better than Karl Fogel's book. The online version of his printed book doesn't have musings on the nature of open source, but the CVS-specific chapters of the book are on-line and copyrighted under the GnuGeneralPublicLicense.

CVS BestPractice by The Linux Documentation Project
http://www.tldp.org/REF/CVS-BestPractices/html/index.html

Quick and Dirty Guide to CVS
http://www.cs.umb.edu/~srevilak/cvs.html - Learn CVS in 21 minutes!

CVS on RedHat 7.2
CvsOnRedHat

CVS on MacOsx
http://developer.apple.com/internet/macosx/cvsoverview.html There are some factual errors here. Not a good introduction for the novice. The CvsBook is better.

CVS for Windows
I found the download page hard to find, so here it is http://www.cvshome.org/dev/codewindow.html

Argh. And in fact, that's not the whole thing. What you want to do is go to http://ftp.cvshome.org/win32/ and download the latest even-numbered zip (e.g. http://ftp.cvshome.org/win32/cvs-1-10.zip).


How to set up a ConcurrentVersionsSystem repository on your own machine.

(Beware UnixCulturalAssumption; see http://cvsbook.red-bean.com/cvsbook.html#Getting_And_Installing_CVS)

Initial Setup Do I have CVS installed on my machine?

Probably. Type cvs at your shell prompt and see. Type which cvs to see where it lives (this tutorial will assume it lives as /usr/local/cvs).

If you've never used cvs before, type the following to set it up initially.

 sudo mkdir /usr/local/cvsrep            # Make the repository.
 sudo chmod g+w /usr/local/cvsrep        # Group (usually wheel) can use the repository.
Cvs uses an environmental variable called CVSROOT to show the path to CVS. Edit your .bash_profile to include the following:

 CVSROOT=/usr/local/cvsrep
 export CVSROOT
Save your profile and load it.

To start CVS for the first time type:

 cvs -d /usr/local/cvsrep init           #If you haven't changed your .bash_profile.
 cvs init                                #If you have.


As a casual Unix user, I missed the whole "chgrp & chmod g+s" trick to get cvs additions to be available to everyone. This didn't seem to be covered well in the FAQs and other documentation. Maybe I missed something, or maybe native Unix users consider it obvious. It wasn't obvious to me. Initially I had all the CVS users in the same default group, now I know that's not necessary. Maybe there are some other not-so-obvious tricks, as well?

Here's a slightly more detailed explanation:

cvs creates files with the user as owner, and the user's default group as group. so if somebody else comes along, they can't get at those files unless they're in the same default group. Unless:

chgrp PROJECTGROUP on the existing stuff
chmod g+s on the project directories
That way any files or directories created inside the project are in PROJECTGROUP, and the g+s propagates the group setting to new subdirectories. Now anyone in PROJECTGROUP has full access to existing and new files.

To do this to an already existing project tree:

 chgrp -R projgroup dir
 chmod -R g+w dir
 find dir -type d | xargs chmod g+s
Sometimes it is also feasible to make cvsroot's mode +t. But usually it's cleaner to just have separate repositories for all groups of users.


A very useful cvs command:

    cvs -nq up
shows you a status summary without changing anything.


CategoryConfigurationManagement


EditText of this page (last edited June 25, 2013) or FindPage with title or text search