% setenv CVSROOT ~/CVSRepository
% cvs init
(NOTE: notice that the directory ~/CVSRepository now exists)
% cd
% mkdir pa0
% cd pa0
% cvs import -m "Setting up pa0 module - first import" pa0 vtag rtag
-m option specifies a log message
% cd
% rmdir pa0
% cvs checkout pa0
At this point you have set up and checked out a working version of your programming assignment. You only need to do these steps 1 - 4 once each time you start a new programming assignment. The rest of these steps (5 - 7) are what you would normally do every time you come in to work on your programming assignment.
% cd pa0
% vi pa0.h ... etc.
% cvs add file
You can also use the *.s, *.c, and *.h wildcard to match all the assembly,
C, and header files in your directory
% cvs add *.s *.c *.h
% cvs commit file
This will bring up an editor session for you to edit a log message about
the changes you made to this file since the last commit. This is just a
log message for you or anyone else looking at the logs to get a high-level
idea of what changes were made. You can specify the log message in the
commit command using the -m option.
% cvs commit -m "Your log message" file
If you have several files you want to commit at the same time with the same
log message, just don't specify the filename. Only those files that have
changed since the last commit on them will be updated/logged in the
repository
% cvs commit -m "Common log message for all files being committed"
The normal cycle once you have set up and checked out your module is 5, 6, and 7 above -- edit, add (for new files), commit cycle.
% cvs update -p file > file
NOTE: Be sure to use the -p option.
If you need a different version saved with an earlier commit, use cvs diff or cvs log to determine which revision number you want to retrieve. Let's say you want revision 1.4 in this example
% cvs update -r 1.4 -p file > file
NOTE: Be sure to use the -p option.
Now your working version of the file has been replaced with whatever version you specified. Go ahead and edit and commit when you are ready to commit your changes to create a new revision of this file.
% cd MyProjDir
% cvs import -m "First import" MyProjDir tag1 tag2
N MyProjDir/log.txt
N MyProjDir/main.cpp
No conflicts created by this import
-m "First Import": specifies log message
MyProjDir: specifies name of Module
tag1 and tag2: logical tags which I never use
(NOTE: If -m isn't used on the command line then vi will start so that
you can edit a log message. To start typing press 'a' or 'i'. To
finish and save the message go to escape mode by pressing ESC and then
type ':wq'. You can use a different editor by using the -e option for
cvs)
-e editor
Use editor to enter revision log information.
Overrides the setting of the CVSEDITOR and the EDI
TOR environment variables.
% cd
% mv MyProjDir MyProjDir.bak
% cvs checkout MyProjDir
% cd MyProjDir
And off you go into the edit, add (for new files), commit cycle.
Special thanks to Michele Strout and Adam Barna for their help with these
notes.
These notes were adopted from Michele's
CVS Notes