Header
Home Page of Simon Bouvier Zappa -- JeLLo Cubes v2




CVS Repository Corner

CVS ( Concurrent Version System ) is a computer data archiving tool that keeps track of the several versions of a project. This tool is commonly used in software development ( i.e. C, C++, Java, Perl... ) or for ascii format text ( Latex ).

This current guide will explain how to set a new CVS repository on a Unix system using SSH. Before we begin, make sure you have the following packages installed:

cvs
ssh ( either openSSH or ssh.com will do )

First of all, if you have root access to your machine, you might want to create a specific user for all of your projects. This particular user can host your repository which can be accessed by all users of the same group. Edit the file /etc/group to edit group features between users. This last file should resemble the following:

RepositoryUser:x:1000:user1,user2,user3
user1:x:1001:
user2:x:1002:
user3:x:1003:

Of course, if you cannot edit users at will, you may host your repository on your own account. Execute the following command to create your repository:

cvs -d :local:/PathToRepository init

To access your newly created repository from another machine, set these two environment variables:

export CVSROOT=":ext:RepositoryUser@yourhost.com:/PathToRepository"
export CVS_RSH="ssh"

for bash shells or

setenv CVSROOT ":ext:RepositoryUser@yourhost.com:/PathToRepository"
setenv CVS_RSH "ssh"

for sh, tsh, psh shells. Register these settings in your $HOME/.bash_profile file or equivalent.

You can now add a new module or project into your repository. To do so, execute the following command into the new project directory:

cd YourNewProject/
cvs import -m "Optional message" MODULE_NAME vendortag releasetag

Make sure your project directory is free of temporary files or any other unwanted files in a CVS repository. ./*~ cache files and ./.* hidden files particularly should be removed when committing initial review. Once the initial import is done, you can check out a copy of the module on your working computer. To do so, execute one of the following commands:

cvs checkout MODULE_NAME
cvs co MODULE_NAME

When committing changes on the working module to the repository, execute one of the following commands:

cvs commit [FILES (optional)]
cvs ci [FILES (optional)]

If no files are specified, every files in the current directory and subdirectories will be committed to the repository. Each file possesses a version number which will grow as more changes to the repository are made. Updates to the current working copy of the repository can be made using the following command:

cvs update

Modifications to the main structure of the repository can be made using the two following commands:

cvs add [FILES]
cvs remove [FILES]

which respectively add new files in the repository or remove them from this same repository.

When using ssh with CVS, it becomes interesting to create a set of public/private keys for the users willing to access the repository. Run one of the following commands to create these keys on the remote machine:

ssh-keygen -t dsa
ssh-keygen -t rsa

Then, copy the generated public key .pub file in the repository account. Move it to the .ssh2 or .ssh directory. Finally add the following line to .ssh2/authorization:

Key yourPublicKey.pub

From now on, the user specified by the public key should be able to access the repository without proper knowledge of repository user password.


Valid HTML 4.01! | Valid CSS!