Check out a project

Last modified: October 2, 2008 - 12:44

Once you have an existing project to work with, you can use your CVS account to check out the project code whenever you need to. With a new project you will normally only have one version to start with. If you are taking over an existing project, it may have multiple branches already. Here are the steps to check out an existing project from CVS so that you can work on the code and commit your changes.

These steps assume you are using a command line CVS client.

  1. On your local computer, go to the place you wish to keep the checked out code.
  2. Enter the following to let CVS know who you are and which repository you wish to access:
    export CVSROOT=:pserver:cvsusername@cvs.drupal.org:/cvs/drupal-contrib

    where "cvsusername" is the name for your CVS account.
  3. Then enter:
    cvs login
  4. Enter your CVS account password when prompted.
  5. Now check out the module and version that you want to work on, for example (note that modules can be switched for other project types, like themes or profiles and project_name is the name of the module, theme, etc.):

    For the HEAD version:

    cvs co -d project_name contributions/modules/project_name

    For the Drupal 6 branch:
    cvs co -d project_name -r DRUPAL-6--1 contributions/modules/project_name

    For the Drupal 5 branch:
    cvs co -d project_name -r DRUPAL-5 contributions/modules/project_name

    (Read more information about CVS checkout commands)

Note that many developers work on multiple versions at the same time (if, say, you are supporting both the Drupal 5 and Drupal 6 versions of your project). For clarity's sake it is recommended that you create a checkout folder for each version to make it clear which version you are working on at any given time. An example directory structure could be like:

myprojects (your main Drupal projects directory, wherever that may be on your computer)
- myfirstmodule (a folder for my contrib module)
--- HEADmyfirstmodule (the HEAD check out of the module)
--- 6myfirstmodule (the DRUPAL-6--1 branch check out)
- sometheme (a folder for my contrib theme)
---HEADsometheme (HEAD check out of the theme)
---5sometheme (the DRUPAL-5 branch check out)

In this example the HEAD*, 6* and 5* folder names for the check outs were done by setting those names in the -d flag of the checkout command, like so:

cvs co -d 6myfirstmodule -r DRUPAL-6--1 contributions/modules/myfirstmodule

Obviously, feel free to keep your checkouts organized however you like. Just keep in mind that one of the most common mistakes is to think you are working on one version when you are really in another.

 
 

Drupal is a registered trademark of Dries Buytaert.