Setting up CVS (for administrators)

CVS is a version control system. You can use it to keep a record of changes to your source files and to share files between multiple people working on a software project. This document is intended to provide a quick overview of how to setup CVS. These instructions are intended for the configuration manager or cvs administrator, not for CVS users. In general, you should only need to carry out this procedure once.
  1. Create a directory where you want the repository to reside - You'll probably want the repository to reside in your home directory of your unix account. Decide on a name for the directory, such as "cvsrepository". All we need to do is just create the directory.
  2.         %mkdir cvsrepository
  3. Initialize the repository - Tell CVS you want to initialize the repository, which is done using the cvs "init" command. You only need to issue this command once. Assume your unix account is on Falcon  and your username is "team-jdx"
  4.         %cvs -d /home/team-jdx/cvsrepository init
    This initializes the repository and creates the appropriate administrative files needed by cvs. You must provide the full absolute pathname of the desired directory.
     
  5. Put your existing project documents (if any) into CVS - (You can skip this step if you don't have any existing documents).  For this example, assume there are two files named AppMain.java and AppGUI.java in a directory src/current and we want to "import" them into the CVS repository. Assume we've decided to call our project "teamproject"
  6.         %cd src/current
            %cvs -d /home/team-jdx/cvsrepository
                import -m "Creating project from imported source" 
                teamproject Team3 start
    (The three lines above are to be entered as one command.)  

    In this example, "teamproject" is the name you desire for CVS to use to identify your project. The name "teamproject" will be the name of the directory for your project files within the CVS repository.  (Describe where "teamproject" will be visible.) "Team3" and "start" are the "vendor tag" and "release tag". These can be anything you want them to be and you won't refer to them exept in unusual circumstances. The string after the -m parameter will be entered into the CVS log describing this transaction.
    You probably should delete the original source files in src/current after importing them because now CVS is controlling everything.
     

  7. Set file permissions 
    You must make sure that the other users have read/write/execute access to the repository directory.
            %cd ~team-jdx
            %chmod -R og+rwx cvsrepository

    Also be sure that other users have read/execute access to your team home directory.
            %chmod og+rx ~team-jdx
    If everyone on the team belongs to the same UNIX group then you everything should be fine. Just be sure that the group owns the directory that contains the repository. In other situations, you may have to set file permissions. Refer to the CVS manual for more information.
  8.  
    That's it! The repository is now ready for access by your team.