[Babase] Using CVS with Babase -- Getting the latest Babase
Karl O. Pinc
babase@www.eco.princeton.edu
Thu, 26 Feb 2004 10:46:29 -0600
Using CVS with Babase:
This document describes how to use CVS (Concurrent Version Control)
under Linux, Unix, Mac OS X, or with cygwin in a MS Windows environment.
You want to use CVS so that you can see, and change, the programs and
documentation which make up Babase. CVS allows multiple people to
simultainously view and change shared files (stored in the CVS
repository) without stepping on each other's toes too much. CVS keeps
a record of every change made to every file, and allows the changes to
be viewed and undone if necessary.
For general help see:
http://cvsbook.red-bean.com
Note that the cvs commands below will ask you for your password on
login.biology.duke.edu in order to access the shared repository.
Preliminaries:
After you login, before you can use cvs you need to
run the following command:
export CVS_RSH=ssh
This command can be added to your .bash_profile in your
home directory so it's always run for you whenever you login.
Before using CVS for the first time:
Before you use cvs for the first time you will need to tell CVS where
it's repository is by running the following command:
export
CVSROOT=:ext:YOU@login.biology.duke.edu:/biology/groups/babase/cvs
where YOU is your username.
Then get your own copy of the repository with the command:
cvs checkout babase
This should create a directory called 'babase' in your current
directory. (If you get a message like "Cannot access
/biology/groups/babase/cvs/CVSROOT" then duke's server is probably
slow. Try again.)
That's it. You only need to go through this to obtain an initial copy
of the shared repository. After that these commands arn't needed as
you will be working with your copy of the repository.
To see the most recent copy of Babase:
Go into the babase directory which has your copy of the repository and
type:
cvs update
This will make your copy current. You can now look at the most recent
version of all the files.
Using CVS to look:
To view a log of all the changes made to a file:
cvs log FILENAME
To see a log of all changes:
cvs log
You will note that each change has a revision number. To see the
difference between two revisions use:
cvs -Q diff -c -rREVISION1 -rREVISION2 FILENAME
Where REVISION1 and REVISION2 are the two revisions you want to compare.
Or, you can use dates instead of revision numbers:
cvs -Q diff -c -DDATE1 -DDATE2 FILENAME
In this case you may want to leave off the filename (and perhaps the
-Q) and you will see all the changes made within the current
directory.
Finally, you can report any changes between the current version of
babase in the repository and what's in your copy of the repository
with:
cvs -Q diff -c FILENAME
Again, leaving off the FILENAME reports all changes within the current
directory. This is useful to see what changes have been made since
you last looked, as well as to report on any changes you may have made
to your local copy of the repository.
Using CVS to change things:
Copying a changed file into the shared repository:
When you've changed a file and you want to make those changes
permanenant, and copy them to the central repository, type:
cvs commit -m 'Description of change' FILENAME...
You can type more than one FILENAME, as indicated by the ellipsis.
Whatever you type for "Description of change" is recorded as the log
entry for the change.
It's a good idea to 'commit' multiple files at the same time if the
changes to these files all go together. This is because CVS is weak
and the only way to tell connect changes made to different files is
through the log entry (comment) supplied with -m when the changes are
committed.
Adding a new file to the repository:
Create your new file and then type:
cvs add FILENAME
cvs commit -m 'Description of new file' FILENAME
Undoing a change:
Rather than describe how to do this here, I'll refer you to:
http://cvsbook.red-bean.com/cvsbook.html#Examining_And_Reverting_Changes
The basic idea is to see what the change is, modify your copy to undo
it, and then do a 'cvs commit -m "I undid the change" FILENAME' to
make the undo permenant.
Karl <kop@meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein