For those of you who do web development on the server
or for any other reason that you might want a versioning
system here is how to go about setting up CVS on this
machine.
For starters you will need a shell acount. We don't deal
with the pserver stuff so everything goes through local
file system transports or over SSH if you are remote.
To use CVS, you need to tell CVS where your repository
will be located. For instance, mine is in ~/cvs-rep. To
tell CVS this set the environment variable CVSROOT. In
csh or tcsh use:
setenv CVSROOT /home/username/cvs-rep
Later, when you want to access your repository from a computer
at home such as your laptop you will want to set CVSROOT to
be something like the following. This only works for Macs,
*nix, and/or Cygwin setups. WinCVS users are on their own.
setenv CVSROOT :ext:username@norcalttora.com:/home/username/cvs-rep
The ext means that you'll be using some other protocol for
transferring files (We'll use SSH). username is your login
name on the server. norcalttora.com is the servername. And
the final path is the path to the repository.
Let's make the repository directory now:
mkdir /home/username/cvs-rep
Now let's actually create our CVS repository:
cvs init
Wahoo. We're ready to get started. Change into the directory you want
to add. For instance:
cd /www/docs/norcal
cvs import norcal norcal norcal1
cd ..
mv norcal norcal-old
cvs co norcal
So what we did there was import everything in the norcal directory
into a module called norcal. Then we ditched our original sources
and checked out the module where it used to be. Hack away.
If you ever add a new file or directory to your bunch of files you
need to add it to the repository like so:
cvs add *
cd mydirectory
cvs add *
cd ..
cvs commit
After you've added everything change back to the directory you started
in and type cvs commit A Vi window will pop up and ask you
for some text to type in. If you've never used Vi before it can be very
daunting. Press the 'i' key and then type whatever you want to record
in there. This bunch of text will be saved with these changes. Normally
you will want to document what changes you made to this revision. Here
something like "initial rev" would suffice. When you are done typing
press <ESC> and then type :wq
Now if you want to work on your code from somewhere else you'll need
to check out your stuff. Set up the CVSROOT environment variable as
above and then type cvs co dirname where dirname is the
name of the directory you first added.