DNA Cafe | Download | FreeSoftware | Java | Links
CVS is a version control system, which allows you to keep old versions of files (usually source code), keep a log of who, when, and why changes occurred, etc.
The first thing to understand is that CVS stores all files in a centralized repository.
The CVS repository stores a complete copy of all the files and directories which are under version control. Normally, you never access any of the files in the repository directly.
Initialize a repository by adding the CVSROOT subdirectory and some default control files. You must use this command or initialize the repository in some other way before you can use it.
$ mkdir CVS_root_directory
$ CVSROOT=CVS_root_directory
$ export CVSROOT
$ cvs init
To bootstrap new sources into the source repository as vendor branch.
$ cd source_distribution_directory
$ cvs import repository vendor_tag release_tag ...
Specify a symbolic tag for files in the repository, uses working directory.
$ cvs tag tag
Explicitly specify a symbolic tag for particular revisions of files in the source repository.
$ cvs rtag -b
-r existing_revision_or_tag
branch_tag
modules
$ cvs admin -n new_branch:old_branch
The first thing to understand is that CVS stores all files in a centralized repository.
$ mkdir work_directory
$ cd work_directory
$ cvs checkout -r revision_or_tag modules
$ cvs add directory
$ cvs add file
$ cvs remove -f file
Please see CVS FAQ. Because 'rename' doesn't mean single way, you know?
$ cvs update -d -r revision_or_tag
$ cvs diff [-c]
[-r revision_or_tag [-r revision_or_tag ...]
$ cvs commit
$ cvs release
On the server side, inetd knows to run the command cvs pserver when it receives a connection on the right port.
Put a line like this into each file (after checking to make sure it isn't already there):
cvspserver 2401/tcp
cvspserver stream tcp nowait root /usr/bin/cvs cvs -f --allow-root=path pserver
cvs: LOCAL
If you use xinetd such as RedHat, put configuration file for cvs pserver.
And send SIGHUP signal to reread its configuration file.
Next, put a password in the CVS passwd file. This file is `$CVSROOT/CVSROOT/passwd'. Here is an example file:
anonymous:
daisuke:tGX1fS8sun6rY
someone:1sOp854gDF3DY:pubcvs
It is normal to edit the `passwd' file in-place. This is because of the possible security risks of having the `passwd' file checked out to people's working copies.
(Here is a simple program to make encrypted entries. → cvspasswd.tar.gz)
And check out CVSROOT to edit configuration files.
$ cvs checkout CVSROOT
SystemAuth=no
anonymous
daisuke
someone
daisuke
someone
And commit it.
$ cvs commit
CVS use the `rsh' protocol to perform these operations.
In server side, create new users to access repository. Add cvs group, and include users this group.
If you have a server which you only want to allow users without providing shell access, you can use rssh to do that.
$ groupadd -g 1234 cvs
$ useradd -s /usr/local/bin/rssh user
$ vigr
For example, group as follows:
cvs:*:1234:user
Change group ownership and file permissions to access repository.
$ cd CVS_root_directory
$ chgrp -R cvs .
$ chmod ug+rwx . CVSROOT
On the client side, you will need to set up two enviroment variables as follows:
$ CVS_RSH=ssh
$ CVSROOT=:ext:user@host:path
$ export CVS_RSH CVSROOT
$ cvs command