CVS is a version-control system. That is, you can use it to keep track of multiple versions of files. The idea is that you do some work on your code and test it, then check it into the version-control system. If you decide that the work you've done since your last check-in is no good, you can easily revert to the last checked-in version. Furthermore, you can retrieve any old version of your code as of some given day and time. The version control logs tell you who made changes and when.
CVS is not the best version control system out there, but it's free and is fairly easy to use.
For more information, visit the CVS home page.
To set up CVS, start by choosing one group member as the keeper of the CVS repository. Everyone in the group will be able to use the CVS repository, but the keeper will actually create the repository and maintain permissions for its contents.
The following instructions are specific to our local setup for the Fall 2006 semester. Even if you've used CVS before, we ask that you read the instructions in their entirety.
Repositories must be created on the machine 'ap2.cs.vt.edu'. This machine
contains a directory that was specially set up for CS 4244 students' CVS
repositories. To access the repository from the other machines, you should first
configure ssh to log you on automatically, without requiring a password every
time. See section
F.2.4 Setting Up ssh, for more information. To connect to this machine use
ssh ap2
from any of the machines in McB 124. You should not
be prompted for a password if you have configured ssh properly.
The keeper has to perform several steps to set up the repository. First, log
on to 'ap2.cs.vt.edu' and create a directory for storing the repository. The new
directory must be created in the directory /shared/cs4244
and
should be named Proj-keeper_pid
, where
keeper_pid is the pid of the keeper. Next, configure access to repository
using the command setfacl --set u::rwx,g::---,o::--- Proj-keeper_pid
.
This command ensures that the user, i.e the keeper has the required permissions
to access the repository, and no one else does. To set permissions for the other
members in the group, use setfacl -m u:member_pid:rwx Proj-keeper_pid
for each of the other members in the group, replacing member_pid with
the pid of the group member.
Next, set the permissions of the directories and files that would be created
inside the repository using the command setfacl -d --set u::rwx,g::---,o::---
Proj-keeper_pid
. To permit all the members of the group
access to all the files and directories created in the repository, use
setfacl -d -m u:member_pid:rwx Proj-keeper_pid
once for each group member (should be used once for the keeper too), replacing
member_pid with the pid of the group member. To make sure that the
permissions are set correctly, use getfacl Proj-keeper_pid
.
Note that neither (Unix-) group members nor others should have read access to
your CVS repository, hence the g::---,o::---
part of the
access control list. (Giving access to group members (in the Unix sense) would
give access to, for instance, all CS majors if your default (Unix-) group is
Major. We use ACLs to give individual access to your CS 4244 group members.)
Failing to protect your repository in this way is an honor code
violation.
Now initialize the repository. To initialize the repository, execute
cvs -d /shared/cs4244/Proj-keeper_pid init
.
Finally, import your source files into the newly initialized repository. If
you have an existing set of source files you want to add to the repository,
cd
to its directory now.
cvs -d /shared/cs4244/Proj-keeper_pid import -m "Imported sources" foobar start |
Here is a summary of the commands you have now executed:
ssh ap2.cs.vt.edu cd /shared/cs4244 mkdir Proj-keeper_pid setfacl --set u::rwx,g::---,o::--- Proj-keeper_pid # for all other group members do: setfacl -m u:member-pid:rwx Proj-keeper_pid setfacl -d --set u::rwx,g::---,o::--- Proj-keeper_pid # for all group members, including the keeper, do: setfacl -d -m u:member_pid:rwx Proj-keeper_pid cvs -d /shared/cs4244/Proj-keeper_pid init |
The repository is now ready for use by any group member, as described below. Having set the repository up, you need not log on to 'ap2.cs.vt.edu' for any other purposes. Keep in mind that the repository should only be accessed using CVS commands--it is not generally useful to examine the repository files by hand, and you should definitely not modify them yourself.
Due to space constraints, 'ap2.cs.vt.edu'should be used only to store the
repository and not for development purposes. Do not store any other files there
and do not run any other programs on this machine. The reason for this somewhat
unusual setup is that our shared file servers currently do not support the
setfacl
commands, making it impossible to protect your CVS
repository.
I strongly suggest that you use the Eclipse CVS integration facilities.
See the following links for details:
http://www-128.ibm.com/developerworks/opensource/library/os-ecshare/
This document was adapted from the materials originally
developed for CS3204