|
This is based on an email that I sent to someone wanting to set up version control of his files on the SRCF system in Cambridge. Hopefully it can also be of some general help to those who want to start using CVS, although there are better and mroe complete references out there.
CVS on kern is not hard to set up but does require some understanding of what you're doing -- have a read of the stuff at www.cvshome.org and (better in my opinion) cvsbook.red-bean.com. The default interface is command line but there's a GUI project at www.wincvs.org that you might find useful.
For starters, set up a repository in your home area on kern -- SSH into kern and type this to initialise your repository:
mkdir ~/cvs
cvs -d ~/cvs init
This will have built a new repository in the cvs directory in your home area. Now try something like this:
mkdir test
cd test
echo "just a test" > test.txt
cvs -d ~/cvs import -m "Initial import of test project" testproj crsid start
This will import the files in the newly created test directory into the repository as a project called testproj. Now try checking it out again:
cd
cvs -d ~/cvs checkout testproj
This will check out a local copy of testproj. Try editing the test.txt file by appending a new line:
cd testproj
echo "This is an addition" >> test.txt
and then commit the change like so:
cvs commit -m "Added a new line"
You can now keep multiple copies of the testproj project on lots of machines (or shared between lots of people if you wanted) and commit changes to the central repository from all of the independantly. CVS will tell you if there are any conflicts. If you want to bring your local copy up to date then go into the project directory and type
cvs update
and it'll happen. If you get weird error messages during the update then
cvs update -AP
will usually solve the problem. The "cvs checkout" command I've mentioned so far will only work locally on kern -- if you want to check out a copy on to another machine then use WinCVS (which I've never used) or, if you have a local copy of the command line CVS client (available from www.cvshome.org) use
cvs checkout -d crsid@kern.srcf.ucam.org:/home/crsid/cvs testproj
There's lots of other stuff, like using version tags and setting up a password authenticating server (so you don't have to type your password every time you checkout/commit/diff/whatever) but you'll work it out if you think it'll be useful.