setenv CVSROOT ursa.astro.ku.dk:/home/aake/cvs # specify repository cvs checkout docs # checkout the "docs" moduleA subdirectory
docs
will be created, with the files in the module
(the file you are reading now is one of them ;-).
cvs watch addWhen you get an email, you may want to see the differences:
cvs diff -rHEADTo import the new version, do
cvs updateIt is not necessary to have the CVSROOT environment variable permanently set (the location of the repository is recorded in the subdirectory where CVS keeps its things).
cvs diffTo check diffs relative to the current version in the repository, do
cvs diff -rHEADTo import the new version, do
cvs updateIt will be merged with your own changes. Possible collision will be signalled, and both versions are available in you file, with comments around.
To commit changes to the repository, do
cvs commit
Your favorite editor will start, and you are requested to enter a line or two with comments about the snapshot. After entering the log message and exiting from the editor, the CVS repository will be updated, and you thus have a new snapshot of your directory.
You may give the log message on the command line, using
cvs commit -m "log message"
It is the files that you originally imported that are updated in the CVS repository, not all the files in the directory. If you make a new file that you would like to also keep in the repository, do
cvs add the-file cvs commit -m new the-fileAfter the next commit, the file will be part of the repository, along with the files that were already there.
To get back to a version from a specified date and time, specify the -D option. Here are some examples:
cvs update -D yesterday cvs update -D "last week" cvs update -D "last month" cvs update -D "27 nov" cvs update -D "27 nov 1999" cvs update -D "27 nov 1999 17:15" cvs update -D "1999-11-27 17:15"To get back to the latest version and clear the "sticky" date tag, for continued updating, do
cvs update -AAnalogously, differences relative to a date in the past may be viewed with
cvs diff -D "1999-11-30"
setenv CVSROOT ~/cvs cvs init
cd that-directory cvs import modulename -m initial yourlogin initialwhere
modulename
is the name of the module. The rest of the parameters
are necessary, but more or less irrelevant.
To add only some file from a directory hierarchy (more typical for us), one has to do little joggling to create an empty module.
cd topofdirs # top of dir structure mkdir tmpd # temporary dir cd tmpd # go there cvs import -m initial modulename yourlogin init # create an empty module cd .. # go up rmdir tmpd # delete the temp dir cvs checkout modulename # check out the empty module mv modulename/CVS . # move the CVS subdir up rmdir modulename # remove the empty dirNow we can add bits and pieces to the new module:
add src # adds the dir, not the files in it cd src # go down into the dir add *.f *.inc # add selected files cd .. # up again add run # same procedure .. cd run add job.csh cd .. cvs commit # commit the addsIn this case, we probably want to create a file
.cvsignore
with
the names and patterns of all files that CVS should ignore
cat > .cvsignore *.o *.x *.log *.spool *.dat *.com CTRL-D cvs add .cvsignore
cvs
itself:
cvs --help cvs --help commandsThe full documentation is available, in HTML form, at TAC.