![]() | ![]() |
grad student quals unix geek person |
CVS InstructionsThese instructions describe how to use an existing CVS-managed project. If you're looking for instructions on how to create a repository, see these instructions on Creating a CVS repository for personal use on the CoC systems.I've set up a CVS repository for our code in my home directory. Here's what you need to do to access it. This should cover the basics. If you want to learn more about CVS, I recommend this CVS tutorial, or you can ask the google gods. Note: these instructions were originally written for the members of my machine learning class project group – you'll need to change the CVSROOT and project name values depending on where your CVS repository is and the name of your project. If this is confusing to you, you'll want to check out one of the more thorough tutorials referenced above. The first thing you'll need to do is set a couple of environment variables to check out the code. How you set them will depend on whether you're working on an inLANd machine (that is, one that CNS maintains) or your own system. I assume you're using Linux, Mac OS X, or some other variant of Unix and that you have cvs installed. If not, you'll need to use a machine that matches that configuration and then copy code back and forth (e.g., via sftp) yourself. Sorry. If you're not on an inLANd system, you'll need to set following environment variables. I'll give you examples as if you're using bash as your shell; if you're using tcsh, you'll need to use a slightly different syntax to set environment variables, but the values will be the same. % export CVSROOT=<username>@gaia.cc.gatech.edu:/net/hc283/eaganj/cvs % export CVS_RSH=ssh Don't forget to fill in your CoC username in the first line. This will instruct CVS to use SSH to access my repository. Note that this setup will also work on an inLANd system, but it's unnecessary to use SSH here. Instead, we can just: % export CVSROOT=/net/hc283/eaganj/cvs Now you've configured the environment so that CVS will know where to look to find the files in the repository. You won't need to do that again, because, once you've checked out the code, CVS will keep track of where it came from. (If you're not inLANd, you will still have to always set the CVS_RSH variable so CVS will know to use SSH.) Checking out CodeThe first time you want to get the code, you'll need to check it out from the CVS server. CVS will still let others work with the code, but you will want to check the code back in each time you make some changes so that you can keep everyone up to date; I'll talk more about that later, but first you need to check out the code.% cvs checkout cs7641 The name of the repository is cs7641. This command will create a new directory in your current directory and will name it cs7641. It will then grab the latest copy of all of the code in the repository and place it in that directory. Any changes that you make should be done under the cs7641 directory. At some point, you'll want to check your code back in. This will copy your changes back into the repository so everyone else can access them. You do that with the checkin command: % cvs checkin Adding filesIf at some point you need to add a new file to the repository, you will need to first put it in your local directory in whichever location it belongs. For example, if I added a new source file Corvette.java (a very fast-moving subclass of a Car), I'd put it in the cs7641/TrafficSimulator/ directory. In that directory, I'd then issue the command:% cvs add Corvette.java This command does not actually update the central repository; it just schedules the file to be added the next time you issue the cvs checkin command. That also means that if you create a file, but forget to cvs add it, it will not be added to the repository when you cvs checkin. Updating your copyAt some point, you'll want to make sure that you have an up-to-date copy of the repository. To do this, you need to issue the update command. This will merge any changes in the repository into your local copy. If there are ambiguous changes, then the CVS system will warn you and you'll have to manually merge the changes, but that's fairly uncommon – usually that can be done automatically. At any rate, just issue the command:% cvs update That should be it! If you have any questions, just drop me an email. Last modified 2 September 2004 at 2:41 pm by eaganj |