c:\WorkSpace\projectA
readme.txt
bin\script1.pl
bin\script2.pl
bin\shell1.sh
bin\shell2.sh
docs\index.html
docs\help1.html
docs\help2.html
c:\WorkSpace\projectB
info.txt
docs\index.html
docs\chapter1\help1.html
docs\chapter1\help2.html
docs\chapter2\help1.html
docs\chapter2\help2.html
docs\chapter3\help1.html
files\script1.pl
files\script2.pl
files\shell1.sh
files\shell2.sh
c:\WorkSpace\projectC
foo.pl
test.pl
This example has files organized into three different projects. Each can exist in CVS separately and still be related.
mkdir c:\cvsroot\CVSROOT
CVSROOT=c:\cvsroot\CVSROOT; export CVSROOT
cd c:\WorkSpace\projectA
cvs import -m "importing initial version of files" projects/projectA mycompany start
cd c:\WorkSpace\projectB
cvs import -m "importing initial version of files" projects/projectA mycompany start
cd c:\WorkSpace\projectC
cvs import -m "importing initial version of files" projects/projectA mycompany start
cvs co projects
The output of this command will look something like this:
U projects/projectA/readme.txt
U projects/projectA/bin/script1.pl
U projects/projectA/bin/script2.pl
...
The "U" standards for update and indicates that the file was updated (i.e. created) on your machine. Alternatively, you could checkout each individual project as follows:
cvs co projects/projectA
cvs co projects/projectB
cvs co projects/projectC
cd newDirectoryName. Next
you need to tell CVS that it has been added. To do this use the cvs add
command as follows:
cvs add newDirectoryName.
cvs commit -m "explanation of what changed" filename
That's it! You now have a record of what was changed and reverse back to older versions of the file if you need to.
cvs status filename
You'll see a bunch of information about the file in CVS with this command, but the "Working revision" will tell which version of the file you have.
You can use the cvs log command to see what other versions of a file are availabile and see the message that was given when the file was commited into cvs.
cvs log filename
cvs diff -r 1.5 -r 1.4 filename
This command compares version 1.5 and version 1.4 of the file and shows you the differences.
cvs update -r 1.4 filename
This command gives you version 1.4 of the specified file.