[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

please check my newbie instructions for remote repository

From: Rusty Wright
Subject: please check my newbie instructions for remote repository
Date: 06 Feb 2005 14:34:58 -0800

I'm trying to help some coworkers start using cvs, and I'm a bit of a
cvs newbie myself.  We have a host, canvas, which we use as our cvs
repository.  If you have the time could you eyeball these instructions
and point out any errors.  (And if you could send me an email letting
me know that you've posted a followup, that would be really great.)



1.  Edit your .login, .cshrc, .profile, or wherever you set your
shell's environment variables and add the following lines:

For csh and its variants use

    setenv CVSROOT :ext:address@hidden:/home/MYNAME/cvs
    setenv CVS_RSH ssh
    setenv EDITOR /usr/bin/ex

For sh and its variants use

    export CVSROOT
    export CVS_RSH
    export EDITOR

Change both occurances of MYNAME to your login on canvas.  If you use a
different editor, e.g., pico, change /bin/ex to the full pathname of
your preferred editor; use "which pico" for example, to get its full

Make your current login session use these environment variables; e.g.,
with csh "source" your .login, .cshrc, etc. file.  Or, even better,
logout and login.  Run the command printenv, or for sh, set, to verify
that these environment variables are in effect.

2. Open an ssh window to canvas and mkdir cvs in your home directory.
For example, with csh or bash you'd do

    mkdir ~/cvs

3. Go back to back to the window for the development machine where
you'll be working and issue the command

    cvs init

====>>> The above steps are once-only.  Thereafter follow the steps
====>>> below to add a new project (aka directory).

1. In the ssh window for canvas mkdir the project directory within
the cvs directory.  For example, if your project directory on the
development machine is named proj_dir then on canvas you'd do

    mkdir ~/cvs/proj_dir

Go back to your development machine's window.

2. On the development machine go to the directory ABOVE the project
directory and run the command

    cvs checkout -l proj_dir

where proj_dir is the project directory.  Then cd into the project
directory on the development machine and run the command

    cvs add *

This will schedule adding all of the files in your project directory.
It will ask for your canvas password so that it can verify things on
that end.  You'll get a warning, "cvs add: cannot add special file
`CVS'; skipping" which you can ignore.

3. To really add (to the repository on canvas) the files from the
development machine, in the project directory run the command

    cvs commit

This will prompt you for your password on canvas, then it will start
your preferred editor so you can add a comment for this revision.
Since this is the initial version, you can say something like "initial
version".  When you save and quit the editor cvs will copy the files to
your repository on canvas (the cvs directory in your home directory).

====>>> The above steps are for setting up a new project.  Thereafter
====>>> follow the steps below to work on the project's files.

I'm assuming you have two machines, the development machine, where you
create and make changes to your files and test these changes.  After
you have verified that things work you then migrate the files to the
production machine and install them.

1. On the production machine, you'll need to get the files from canvas;
go to the directory where you want the project directory (the parent of
the project directory) and issue the command

    cvs checkout proj_dir

This will create the project directory and copy all of its files into

2. Whenever you edit files on the development machine and you're
satisfied with your changes, you incorporate these changes into the cvs
repository on canvas by issuing the following command from within the
project directory

    cvs commit

Like the above, it will prompt you for your password, start an editor
for comments, and so forth.

3. On the production machine you can retrieve these updated files by
going into the project directory and doing

    cvs update

4. If you forget where you are and inadvertently make changes on the
production machine you can do a "cvs commit" on it and then do the
"cvs update" on the development machine to incorporate those changes.
To help remind you that you shouldn't edit files on the production
machine you can use -r with the checkout and commit commands

    cvs -r checkout proj_dir

Unfortunately, you'll have to remember to also use -r whenever you do an
update on the production machine

    cvs -r update

See for the full cvs documentation.

!!!!>>> WARNINGS

Be extremely careful about doing anything to your cvs directory or any
of its subdirectories on canvas.  If you do anything to anything on
canvas after you have done the "cvs init" you will probably lose your
files on the production and development machines the next time you run
any cvs commands.  The cvs command will cheerfully and without any
warnings or prompts remove your files.  While writing this and testing
my steps, several times it removed my stuff.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]