Contents /
Previous /
Next
Working (Multiuser) with CVS
checkout: Getting the source
The first thing you must do is to get your own working copy of the
source:
cd working_dir/
cvs checkout swoop
This will create a new directory called "swoop"
and populate it with the source files.
It will also create a `CVS' directory, that is used internally by CVS.
Now you can start your favorite editor and work on the files.
commit: Commiting your Changes
commit will store your new source files (or modified files)
in the repository and make them available to anyone else:
cd ~/working/
cvs commit swoop
CVS starts an editor, to allow you to enter a log message
(you may type a message like "added superSwooping function",
save and exit or just exit immediately).
The environment variable `$CVSEDITOR' determines which editor is
started.
If you want to avoid starting an editor you can specify the log
message on the command line using the `-m' flag instead.
You can also commit single files from a module:
cd ~/working/swoop
cvs commit index.html
`commit' verifies that the selected files are up to date with the
current revisions in the source repository. It will notify you, and
exit without committing, if any of the specified files must be made
current first with `update' (usually because someone edited
the same file in parallel).
`commit' does not call
the `update' command for you.
update: Bring Work Tree in Sync with Repository
Use the update command when
you wish to update your copies of source files from changes that other
developers have made to the source in the repository.
When other developers changed the source and commited their
changes to the repository while you also changed the source,
you have to update your working copy before you can commit it.
Execute the update command from within your private source directory
to merge your local files with the repository.
Example:
cd ~/working
cvs update swoop
If update reports conflicts in the files you have to
edit the files (by hand) and resolve the conflicts.
After that you may commit the updated files with
your changes and contributions.
diff: Viewing Differences
If you do not remember modifying a file,
you can run diff to see what you changed in that file:
cd ~/working/swoop
cvs diff index.html
diff compares the file version that
you checked out with your working copy
and displays the differences.
release: Cleaning Up
When you finished working on a project (you can always restart),
call the release command:
cd ~/working
cvs release swoop
The release command checks that all your modifications have been
committed.
If history logging is enabled it also makes a note in the
history file.
When you use the `-d' flag with `release', it also removes your
working copy.