CVS

Up

Creating a Repository

Take the following steps to setup a location for your cvs repository. For internal use you do not have to be terribly concerned about security. If you are going to have multiple people accessing the repository with read/write access, I recommend that you set the group of the main repository directory to be that of a group that all users that need access belong to. Then be sure and set that directory's SGID bit to ensure that any new files or directories created in the directory are created with the same group ID. In the example below I'm going to assume you have created a group called cvs. If you need help with this, please see this page.

For a lot more information about the configuration and use of CVS, please see this page.

  1. Decide where you want to keep the repository. For this example, I choose the location /Users/Shared/cvs-repository
  2. Create the directory mkdir /Users/Shared/cvs-repository
  3. Set the group of the directory chgrp cvs /Users/Shared/cvs-repository
  4. Set the SGID bit if the directory chmod g+s /Users/Shared/cvs-repository
  5. Initialize the repository cvs -d /Users/Shared/cvs-repository init

Do an initial check-in of your module

Let's assume you have project files stored in the folder ~/Projects/MyProject that you want to place under CVS control. In the following commands, be sure and replace any reference to this location to the one that is appropriate for your project.

  1. cd ~/Projects/MyProject
  2. cvs -d /Users/Shared/cvs-repository import -m "Initial project import" MyProject vendor_tag release_tag
    where vendor_tag is a symbolic name for the branch and release_tag is a symbolic name for the release. In this example you might your MYPROJECT_DIST as the vendor_tag and R_0001 as the release_tag.

Check out the project under repository control

Again, using the settings from above...

  1. cd ~/Projects
  2. rm -rf MyProject
  3. cvs -d /Users/Shared/cvs-repository checkout MyProject

Repository access

If you are developing on the same machine as where the repository resides, you can access the repository directly, as what we have been doing in the above example. If you are accessing it from a remote machine, I recommend using SSH to access the repository. If you need basic SSH setup help, see my page here. To specify a repository that is on a remote machine that you are accessing via SSH, the syntax looks like this:

cvs -d :ext:ip_address:path_to_repository

CVSROOT/modules file

This is a very useful file. It lets you organize the contents of your cvs repository in useful ways. You can create alias modules to various files and directories in your repository. You can create regular modules that refer to existing directories in your repository as well as letting you specify scripts to be run when a module is exported, commited, checked out, tagged, and updated. You can provide an alternate name to be used as the sandbox directory name when that module is checked out.

Fixing Keywords

If you notice that an image file or some other binary file checked into your repository does not have the -kb tag, indicating it is a binary file and as such should not have keywords expanded inside of it or line endings messed with when it is checked out, you can fix it with the following command:

cvs admin -kb file_name

Importing entire directory to existing module

Suppose you have a module in your repository called BigProject. Further suppose you want to import an entire directory called bob and all of it's subdirectories and files into BigProject/yada/foo, so that when you are done you have BigProject/yada/foo/bob in the repostory.

  • Start with your bob folder somewhere on your computer (but OUTSIDE of any part of a BigProject sandbox that you may have).
  • cd into your bob folder
  • Issue this command: cvs import -d your_cvs_repository import BigProject/yada/foo/bob vendor_tag release_tag

Keywords

$Author$
username of user who committed last revision
$Date$
date when last revision committed
$Header$
author, date, revision, pathname, file status, locked status
$Name$
name the file was checked out under
$Log$
commit messages
$Revision$
revision number


Page last modified on January 31, 2007, at 10:58 AM