Wiki2
CVSTips

CVS tips

Install on a new client

Setup SSH login with empty password

  • Run ssh-keygen on client machine. Leave password fields empty.
  • Move to .ssh/id_rsa.pub to CVS server vis sftp
  • Add id_rsa.pub to the end of .ssh/authorized_keys using cat id_rsa.pub >> .ssh/authorized_keys

Setup CVS environment variables in .profile

export CVS_RSH=/usr/bin/ssh
export CVSROOT=:ext:peter@192.168.0.1:/home/cvsroot/

Import a new project

  • Create empty dummy folder in local CVS root. Should only contain source that you want to include in CVS.
  • cd to the dummy folder (because import works recursively)
  • Import folder
  • Add source that you want to include
  • Commit changes e.g. project root catalog
  • Use e.g. SmartCVS for GUI management

Example …

cd cvsroot
mkdir project
cd project
cvs import project self start
cd cvsroot
cvs co project
cp -R project_source/* project
cd project
cvs add file.txt
cvs commit

Add folder to project

Non recursive

The default behaviour of cvs is to add non-recursively.

cvs add folder
cvs commit

Add folder recursively

A smart way of using find and xargs enables folders to be added recursively.

cvs add folder
find folder -type d -print | xargs cvs add
find folder -name CVS -prune -o -type f -print | xargs cvs add

An alternative way is to use grep utility.

find folder -type d -print | grep -v CVS | xargs cvs add
find folder -type f -print | grep -v CVS | xargs cvs add

Optionally with -n1 for xargs.

Add files to project

cvs add *.rb
cvs commit

Check log

Check commit messages for a file

cvs log <file>

References