CVS Discussion Notes

1) login lindbrook

 

2) $ mkdir cvs

 

3) $ cvs -d $HOME/cvs init

 

4)write into .bash_profile:

export CVSROOT=$HOME/cvs

 

5)$ exit

login

 

6)$ echo $CVSROOT

to check if CVSROOT set

should print directory

 

7) project files in directory myproject

$ cd myproject

$ ls

main.c test.c hest.h

$ cvs import -m "CS130 Project" myproject cs130 start

Creates the files myproject/main.c

myproject/test.c

myproject/test.h

I can call the project sthg else, i.e. test, then files created in CVS are test/main.c, test/test.c

test/test.h

subdirectories of myproject are also imported

$ cd ..

$ move myproject myproject_old

$ cvs checkout myproject

 

8) A typical cvs command will apply to current and all sub-directories.

To add a text file its cvs add <filename>”, “cvs commit”.

Careful! When adding a directory, only the directory, but neither files in the directory nor subdirectories are added. Use cvs import for recursive adding of directories.

To delete its cvs remove <filename>” but it requires manual deletion first.

Both add and remove need a commit

If you do cvs –q update -d”, it will show only affected files.

? means cvs doesn’t recognize the file

A means new file waiting for commit

R means file marked for deletion and waiting for commit

U means file was changed by someone else and updated in your local repository

C means someone else's changes to the file are causing conflicts. It marks the conflict areas inside the file with >> or << depending on which file has lines.

M means that the file has been modified by you but not committed yet.

These are the main. You can do cvs update –help” for a complete list

To check difference between checked in files and your changes:

cvs diff <filename>”

Make sure you do a cvs commit -m "comments" after every change

Make sure you do a cvs update and recompile before you commit

 

9) Tagging

$ cvs tag PRESENTATION1

$ cvs checkout –d myproject-presentation –r PRESENTATION1 myproject

 

10) Branching

Create new branch:

$ cvs tag –b presentation-1-0

Create branch from tag:

$ cvs rtag –b –r PRESENTATION1 presentation-1-0 myproject

Checkout branch

$ cvs checkout –r presentation-1-0 myproject

 

References:

http://ximbiot.com/cvs/manual/