2009-11-14

export CVSROOT='/usr/local/cvsroot'

As superuser, install cvs on the local and remote machines (sudo apt-get install cvs or equivalent). Then, on the remote server:

# mkdir /usr/local/cvsroot/
# cvs -d /usr/local/cvsroot init

[ I left out an important step that - on that makes it clear, even, that the setup of the CVS repository, group, and user are all done from the prvileged (root) account; this next block is it - you know what to do ]

# /usr/sbin/groupadd cvs
# /usr/sbin/useradd -g cvs cvs
# /usr/sbin/usermod -a -G cvs user
# chgrp cvs /usr/local/cvsroot
# chown cvs /usr/local/cvsroot
# chmod 775 /usr/local/cvsroot

[the CVS init command should be issued from a root shell]

Changes to /etc/profile on local machine:

CVS_RSH='/usr/bin/ssh'
CVSROOT=:ext:user@servername:/usr/local/cvsroot
CVSEDITOR=emacs
export CVS_RSH CVSROOT CVSEDITOR

If your remote server uses a non-standard port for SSH (and it should!), add the following to ~/.ssh/config

Host servername
  Port 666

So now you have access to cvs on the remote server. To import an exising project (called a module in cvs), go to its base directory and do this:

me@local:/home/me/tmp$ cvs import modulename companyname START

To check out that project:

me@local:/home/me/tmp$ cvs checkout modulename

Getting started with CVS (tutorial)