CVS
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.
- Decide where you want to keep the repository. For this example, I choose the location
/Users/Shared/cvs-repository - Create the directory
mkdir /Users/Shared/cvs-repository - Set the group of the directory
chgrp cvs /Users/Shared/cvs-repository - Set the SGID bit if the directory
chmod g+s /Users/Shared/cvs-repository - 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.
cd ~/Projects/MyProjectcvs -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 yourMYPROJECT_DISTas the vendor_tag andR_0001as the release_tag.
Check out the project under repository control
Again, using the settings from above...
cd ~/Projectsrm -rf MyProjectcvs -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 -dyour_cvs_repositoryimport BigProject/yada/foo/bobvendor_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
