Security Systems

Simple CVS Instructions

Copyright 2008 by Stephen Vermeulen
Last updated: 2008 Oct 12
Site Index





6 after again against back before button cd control copy create cvs default development img last m made much name online open place print put release right say section select should show simple someone something store table text those tr type versions width xp
Here is a quick outline to setting up and using CVS on Windows (NT, 2000, XP). Unless you need to do branching and merging this is pretty much all the commands you need to know about.
  1. Go to www.cvsnt.org (this site is run by www.march-hare.com) and download the binaries for CVS Server and Client for Windows
  2. Install the binaries somewhere
  3. Now you need to tell the CVS server where you would like to store the files (i.e. your repository), go to the Windows Control Panel, start the CVSNT Server applet. This has a number of tabs, the only one you need to look at is the "Repository configuration". In that tab there is an "Add" button, this will open the "Server Settings" dialogue. In this you need to pick a location for the repository (just navigate to a directory and select it) something like "c:\cvsfiles" will do, and you should check the three check boxes: Publish Repository, Default Repository, Online. Then say OK. CVS will initialize the repository.
  4. Now close the applet
  5. For convenience sake you should add a CVSROOT environment variable to tell the cvs commands where your default repository is. Again, go to the control panel and open the "System" applet. Click on the "Advanced" tab, then click on the "Environment Variables" button. Now in the "User variables" section press the New button and then enter "cvsroot" for the variable name and "c:\cvsfiles" for the variable value. Click OK to close all the dialogues.
  6. Now start a command prompt and type cvs -v, this should print out version information about CVS
  7. Next prepare a directory containing the files for the first project you want to place into CVS, lets call the project "mole"
  8. CD into the project directory (note the name of this directory is not important, also you may want to setup a simplified directory tree that just contains a portion of the whole project and import that first, then do a cvs checkout and then use cvs add to bring the rest of the files into the project - the import command will place all files and subdirectories into CVS) and type the command: cvs import -m "" mole mole initial
  9. The mole project is now in CVS, to check that this is the case CD to some other directory and type the command: cvs checkout mole
  10. You should now find a new sub directory called "mole" with the files you imported in it.
  11. Now CD into the new mole directory and modify one of the files
  12. Run the CVS command: cvs -n update
  13. This will tell you that you modified one of the files
  14. If you do the command: cvs commit -m "A first test commit"
  15. the change you made to the file will be committed to CVS
  16. If you reach a particular point in your development of the files (say you release a copy to someone else) you can mark the exact version of those files in CVS for future recall (if needed).  To do this you first do a cvs commit so that version is in CVS, then you do a: cvs tag tag_name
  17. this will put the symbol "tag_name" (which you put something useful in) on the current version of all the files in your project, later you can checkout that particular version (if you need to patch a bug) or you can diff against it.
  18. To see what the various versions were on a particular file you can do a: cvs log filename
  19. To see what you have changed in your local copy of a file compared to the previous version of the file you can do a: cvs diff filename
  20. To add a new file to your project, just create it in a project directory you have checked out of CVS and then run the command: cvs add filename, after this you will need to do a: cvs commit command before the file actually enters CVS
  21. If you need to store binary files (like JPG images, Word documents...) in CVS you need to use the -kb switch when adding them, so a command like cvs add -kb picture.jpg would be correct.



                back to vermeulen.ca home