CVS Quick Reference


Table of Contents

CVS Command Summary 
Get quick help 
Login 
CheckOut 
Update/Check 
Diff 
Commit Changes 
Add New File to CVS 
Add New Directory 
Add Binary file to CVS 
Check update history 
Check directory update history excluding the files within it 
Change version message 
Remove File 
Remove Dir 
Rename File 
Rename Directory 
Create Snapshots 
Comment 
Quick reference guide to CVS commands 
CVS Quick Reference 
CVS none-usual operations 
Import 
rename 
Remove versions 

CVS Command Summary 

export CVSROOT=:pserver:user@host.domain.com:/home/cvs/dir

Get quick help 

cvs --help
cvs -H commit
cvs -H add

Login 

cvs login

CheckOut 

cvs checkout

Update/Check 

cvs -q update [file]

Diff 

cvs diff [file]

Commit Changes 

cvs -q commit -m "Comments:........" [file]

Add New File to CVS 

vi file.ext
cvs add -m "creation log:....." file.ext
cvs commit

Add New Directory 

mkdir new_dir
cvs add new_dir
Add New SubDir Tree:
cvs add dir_new
cvs add dir_new/*
cvs -q commit -m "- add directories"

Add Binary file to CVS 

cvs add -kb -m "creation log:....." file.bin
cvs -q commit !$

— commit right afterward

Check update history 

cvs log <dir/file>

Check directory update history excluding the files within it 

cvs log -l <dir>

Change version message 

cvs admin -m1.2:"- new text" <dir/file>

Remove File 

rm -f file.ext
cvs remove file.ext

Remove Dir 

rm -rf dir_unwanted
cvs remove dir_unwanted/*
cvs update -P

Rename File 

mv f1 f2
cvs remove f1
cvs add f2
cvs -q commit -m 'Remove ...'

Rename Directory 

mkdir newdir
cvs add newdir
mv olddir/* newdir/

Create Snapshots 

cvs -q update -D "YYYY-MM-DD"

Comment 

Once you've set CVSROOT and download every file from the cvs server, you won't need to specify CVSROOT any more for cvs status and cvs update, because it is recorded in the cvs archive, under every directory, in file CVS/Root. You still have to issue cvs login (or equivalent) every time before you connect.

Note, yet for cvs checkout, you still need to set CVSROOT.