home > cvs
CVS is a great version control system. It has some shortcomings, and in time will probably be superceeded by projects such as Subversion, but at the time of writing (February 2005) it is still the most widely used open source version control system.
On these pages I’ve put together a couple of how to articles that describe how I’ve managed to solve a couple of problems that I hope will be useful to others, along with a quick reference of some useful CVS commands.
The best documentation on how to do almost everything in CVS is Open Source Development with CVS. Even more complete, but less easy to read and navigate is the CVS Manual.
When I set up my mac so I could use CVS, I used the concise basic instructions at macworld.
These notes are somewhat outdated now that most folk are using OS X 10.3 Panther – the only difference really though is that the default shell under Panther is bash, so you’ll need to use the bash syntax to set your CVSROOT environment variable in ~/.bash_profile instead of ~/.tcshrc.
Basically you decide where you want your repository to live; create a directory for it called cvsrep. Then add the staff group and grant it write permissions, like this:
crb% sudo chgrp staff cvsrep
crb% sudo chmod g+w cvsrep
I then set my CVSROOT environment variable to indicate the location of the directory I chose to create my repository in. I added the line:
setenv CVSROOT ”/Volumes/Data/Home/dev/cvsrep”
to ~/.tcshrc and saved… then loaded the new .tcshrc:
crb% source ~/.tcshrc
And initialized the repository:
crb% cvs init
I then followed the instructions for creating and adding a test project.
crb% cd ~/Desktop/TestProjectImport
crb% cvs import -m “Initial project import” testproj me start
NOTE: Binary files must be added using the -kb flag. This tells CVS not to convert line endings or to substitute keywords – modifications which could corrupt your binary files. Once added with this flag, they are then updated and committed the same way as text files. For more info see the CVS Book Section on Binary Files