How to create a CVS repository
CVS is suitable for collaboration on papers and for repositories with large files, such as data. It stores on the client only the latest version of the files; the complete history is only in the repository on the server.
Other version control systems, such as git are recommended for software projects.
On the server
This is the machine where your repository will be.
- Ask system administrator to create a group that would contain all users you want to have access to the repository, say, mygroup
- Create a cvs directory in your account on the server, say /home/me/cvsroot . This is where all your CVS projects will be.
- Make sure the directory is owned and fully accessible by your group:
- chrgp mygroup /home/me/cvsroot
- chmod g+rwxs /home/grads/me/cvsroot
Have someone in your group check if they can
- cd /home/grads/cvsroot; ls -l
If not, do chmod g+x on all directories above up and including your home directory. Note: you should not have in your home directory anything you do not want others to see. Put all private files in protected subdirectories.
- initialize your cvs directory: cvs -d /home/me/cvsroot init
- make empty directory where your first project will be: mkdir /home/me/cvsroot/project
On the client
This is where you want to work, usually your laptop, but it can be the same as the server.
- install cvs if necessary and make sure you can ssh to the server
- set environment, in bash export CVSROOT=me@server:/home/me/cvsroot
- try cvs checkout project and subdirectory project should be created
- cd project and add files and directories by cvs add and cvs commit usual way
When something goes wrong
- you can ssh from the client to the server (passworldess ssh configuration highly recommended)
- both the server and the client use a contemporary version of cvs, obsolete versions may behave differently
- all files and directories in the repository are owned by your group, files should have the at least rw group permissions and directories the rwx group permission with s set
- others in your group can cd to the repository
What does not work in CVS
- committing an empty directory
- links (soft or hard), cvs will consider them the same file with bad results
- file with names that differ only by capitalization - OSX default filesystem is not case sensitive so these are the same file, but two files for CVS, with bad results
- merging changes on cvs update in
- binary files, such as from MS Office, or pdf files (you can store binary files in CVS just fine, but a merge will corrupt them)
- files edited with an editor that changes the ends of lines (^M or not ^M, the whole file will be a conflict)
- files with really long lines (such as a whole paragraph in one line, the whole paragraph will be a conflict)
- CVS 1.11, 1.12
- Linux, OSX, Cygwin on windows (your mileage may vary)