Every now and then I need to write quick intros to collegues on how to start using CVS. Maybe if I blog it once, I can point the post instead of writing e-mails on the topic again and again.
The purpose for using CVS is to maintain revision history for a set of files. Usually source code and related documentation. This enables controlled changes and concurrent development for teams that work over the same files.
My tool of choise for using CVS on Windows platform is the Tortoise CVS. It's easy to use and integrates nicely to your Windows explorer.Some recurring terms in use of CVS that you need to understand are:
- remote user account
- terminal client
- CVS-root
- repository
- local sandbox.
server. On that server there is one certain directory that called the CVS-root. In this directory there can be serveral projects hosted and each one of these is called project's repository, which is the master location for the files. You will get and work with a copy of thise files at your local sandbox.
So as an example; Let's say that the server name is foo.bar.fi and on that host there would exist a CVS-root /srv/cvsroot. Furthermore the CVS-root holds the project you are working on and the file repository for the project is called myproject. That is the information you need to locate and use the repository.
Additionally you need remote user account and access to the server foo.bar.fi in order to get to the files at all. In this example, let's call your user account mylogin.
Once you have all that figured out, you have all the capabilities you need to use CVS. You only then need the tools, so download a copy from the Tortoise CVS site and install it on your workstation. After that you're all set.
First thing to do is to ensure that your remote access to the server works. Remote access is nearly always done over a secure terminal client. The client for this task with Tortoise CVS is the TortoisePlink.exe that was installed on your host. First test that your access to the host works by trying to log in from command line:
cd "Program Files\TortoiseCVS"
TortoisePlink.exe -ssh -l mylogin foo.bar.fi
If this is the first time you connect to the host, you will be asked to verify the encryption key that the remote server is going to use. The key fingerprint is the one you need to look out for.

You must make sure that this is the one you should expect to get from the host. If the fingerprint matches, accept it and you should be asked for a password. Enter your password and you should see successful login happening. Then just logout.
Now your remote access should be functional and we get to checking out some files.
Open Windows explorer/My Computer on your preferance, create a directory cvswork and right-click on the cvswork directory. On the menu that appears, there should be option CVS checkout. Select that one and you get a dialog to which you must enter the CVS access information:

When selecting ok, you will be prompted for a password (possibly even a few times) and after that the files are downloaded to your host.
Then go editing the files at the location where you got them. Once you are done, you should:
- right-click on the local sandbox and select update (this way you will get all the updates to the files that your team mates have done before you commit your changes)
- right-click on the local sandbox and select commit
- when asked so, enter comment about the changes you did to the files so that the change history of the files will get reasonable notes about what has been done.
You can get rid of the constant querying for a password by using SSH-public key authentication, but that is worth a post of it's own.
