Overview
- Multiple users working on a project
- Merges rather than locks
- Directories managed as a unit
- client-server mode
Setting Up
Adding Files
- Create directory:
mkdir blah
- Add the directory to the repository:
cvs add blah
- Create files in the directory.
- Then, cvs add the files.
-
Finally, cvs commit .
Common Commands
- cvs checkout
- Check out a new working copy
- cvs commit
- Check local changes into the repository.
- cvs update
- Update local copy with repository changes.
- cvs diff
- Show differences between local copy and repository.
- cvs tag
- Tag a group of related files.
- cvs log
- Examine comments made on revisions.
- cvs annotate
- Determine who broke the code or made a change.
Updating
In order to see changes others have made, you must run cvs update
Points to consider:
- Use the -d flag to get new directories that have been added.
- If you and someone else change the same
file , you may get conflicts.
- Update before checking in changes.
The following letters may appear next to files in update:
- U
- File replaced by a new version from repository
- P
- File patched from CVS server
- A
- File added but not yet committed
- M
- File locally modified
- C
- File has conflicts
Fixing Conflicts
Whenever an update produces conflicts, the original source file will be marked up as follows:
krb5_magic magic;
krb5_data realm;
<<<<<<< func.h
char *pname; /*Single string containing name.*/
krb5_int32 type;
=======
krb5_data FAR *data; /* An array of strings */
krb5_int32 length;
>>>>>>> 1.2
} krb5_principal_data;
The text between the line of less thans and the line of equal signs is
the text from the modified local file. The text below the line of
equals signs is from the repository. Resolve the conflict by
combining these two sections to produce the desired code.
Committing your Changes
- Change the files.
- Update to pick up others' changes.
- Run cvs commit .
- Enter a log message describing your changes.
Other things to do
- Use branch tags to manage parallel development.
- Send email when files are changed.
- Collect parts of the source tree into named modules.
- Use client-server mode to locate the repository on a central server.
For information on these topics, see the CVS documentation in Emacs info.
![[BACK]](images/back.gif)
Prepared by
Erik Nygren (nygren@mit.edu)
and
Sam Hartman (hartmans@mit.edu)