GNU Concurrent Versions System
[1] Setting up a CVS repository on your account | [2] Setting up other members in group to use CVS on your account | [3] Basic CVS commands | [4] Resources
[1] Setting up a CVS repository on your account
A. Adding the CVSROOT environment variable
- Add the following two lines to your .cshrc (or equivalent) file:
umask 007
(this will replace any existing umask)
setenv CVSROOT $HOME/.cvsroot
(.cvsroot is the main CVS repository)
This sets up the CVSROOT environment variable, which is needed by CVS (for example, $HOME = /u2/rmflatt/ ). - Logout and log back in for these changes to take affect
B. Setting up the CVS repository so that other group members and yourself can checkout/in files.
- Go to your root directory
- type:
groups
(this determines which groups you are a part of. Remember the group name you wish to use CVS with) - type:
umask 007
(all new files will be locked to outsiders but readable and writable by the owner and group of the file) - type:
mkdir .cvsroot
(this is the CVS repository) - type:
chgrp group_name .cvsroot
(allows the group ‘group_name’ access to the .cvsroot repository - substitute group_name with a group name from step 2 [i.e. cs354_31] ) - type:
chmod 2770 .cvsroot
(makes the repository owner and group readable and writable) - type:
mkdir .cvsroot/CVSROOT
(all the files that CVS needs are stored within this directory) - type:
mkdir .cvsroot/project
(whereproject
is the name of the project you’re working on. Make as many ‘project’s as desired. A module with the name ‘project’ will be used [this name goes in the filemodules
, as described on step 12]) - type:
cvs init
(this populates the .cvsroot/CVSROOT directory with the files that CVS needs. This step assumes the CVSROOT environment variable has been set) - Go to your root directory
- type:
cvs checkout CVSROOT/modules
(this creates a CVSROOT directory tree in your root) - Edit the file (
~/CVSROOT/modules
) and insert a line that defines the module(s) you’re working on (i.e. ‘project’).
Add the following line at the end of the file (you can add as many modules as needed):
project_name project
(whereproject_name
is the name of the module you want defined, andproject
is the name of the directory containing the files [as created on step 8]) - Save
~/CVSROOT/modules
- type:
cvs commit -m "The message to log with this change" CVSROOT/modules
(this commits this changed file into the repository) - type:
cvs release -d CVSROOT
(this releases (and deletes) the CVSROOT working directory, which you just checked out/in)
To import an existing directory (with files) into the repository:
- Go to the directory that contains any directories/files that you want to import into CVS
- type:
cvs import -m 'Initial checkin' project_name VENDER_TAG RELEASE_TAG
(This imports (recursively) any directories/files in the current directory into the project_name repository. VENDER_TAG and RELEASE_TAG can be anything)
Otherwise, files can be added to the repository via:
cvs add file_name cvs commit
MAKE SURE that the CVS repository is NOT world-readable:
- type:
chgrp -R group_name .cvsroot
- type:
chmod -R g+rw,o-rwx .cvsroot
CVS is now set up on your account for the people in group_name to access/modify/update files within .cvsroot/project
[2] Setting up other members in group ‘group_name’ to access CVS on the account where the CVS repository resides
- Each member should add the following two lines to their .cshrc (or
equivalent) file:
umask 007
(this will replace any existing umask)
setenv CVSROOT /u/mypartner/.cvsroot
(where, in this case, ‘/u/mypartner/’ would be set to what $HOME was above [i.e. ‘/u2/rmflatt/’] ) - Logout and log back in for these changes to take affect
You are now ready to checkout any modules that were created in section [1].
To checkout a project:
- Go to the directory were you want the project to be in (i.e. ~/cs354_31)
- type:
cvs checkout project
(This checks out the ‘project’ module, creating aproject
directory in your current directory, containing all ‘project’ files)
[3] Basic CVS commands
cvs checkout project
–> to checkout files from the ‘project’ module in the repository onto your account…
this will create a ‘project’ directory in your current directory, which is a working (up-to-date) copy of the files in the repositorycvs update
–> will integrate any changed files on the repository into your [local] files (i.e. your files will change, not the repository files)
-NOTE: if there’s a conflict, it will show up here (in your working directory) in the file the conflict is in -you must resolve these conflicts
-ALWAYS DO AN UPDATE BEFORE STARTING TO WORK ON THE PROJECT…just so you have the most up-to-date files in your working dircvs add file_name
–> indicates thatfile_name
is to be added to the repository (once a ‘cvs commit...
’ is done)cvs remove file_name
–> indicates thatfile_name
is to be removed from the repository (once a ‘cvs commit...
’ is done)cvs commit -m "The message..."
–> will commit any files that you’ve changed in your working directory into the repositorycvs commit -m "The message..." file_name
–> will commit the filefile_name
cvs log [file_name]
–> prints log info [offile_name
] to stdout (pipe this to a file if you want to view the log)
[4] Resources
Created by: Rob Flatt
Last Modified: 030116