1 Date: Tue, 16 Jun 1992 17:05:23 +0200
2 From: Steven.Pemberton@cwi.nl
3 Message-Id: <9206161505.AA06927.steven@sijs.cwi.nl>
7 INTRODUCTION TO USING CVS
9 CVS is a system that lets groups of people work simultaneously on
10 groups of files (for instance program sources).
12 It works by holding a central 'repository' of the most recent version
13 of the files. You may at any time create a personal copy of these
14 files; if at a later date newer versions of the files are put in the
15 repository, you can 'update' your copy.
17 You may edit your copy of the files freely. If new versions of the
18 files have been put in the repository in the meantime, doing an update
19 merges the changes in the central copy into your copy.
20 (It can be that when you do an update, the changes in the
21 central copy clash with changes you have made in your own
22 copy. In this case cvs warns you, and you have to resolve the
25 When you are satisfied with the changes you have made in your copy of
26 the files, you can 'commit' them into the central repository.
27 (When you do a commit, if you haven't updated to the most
28 recent version of the files, cvs tells you this; then you have
29 to first update, resolve any possible clashes, and then redo
34 Suppose that a number of repositories have been stored in
35 /usr/src/cvs. Whenever you use cvs, the environment variable
36 CVSROOT must be set to this (for some reason):
41 TO CREATE A PERSONAL COPY OF A REPOSITORY
43 Suppose you want a copy of the files in repository 'views' to be
44 created in your directory src. Go to the place where you want your
45 copy of the directory, and do a 'checkout' of the directory you
51 This creates a directory called (in this case) 'views' in the src
52 directory, containing a copy of the files, which you may now work
53 on to your heart's content.
57 Use the command 'cvs update'.
59 This will update your copy with any changes from the central
60 repository, telling you which files have been updated (their names
61 are displayed with a U before them), and which have been modified
62 by you and not yet committed (preceded by an M). You will be
63 warned of any files that contain clashes, the clashes will be
64 marked in the file surrounded by lines of the form <<<< and >>>>.
66 TO COMMIT YOUR CHANGES
68 Use the command 'cvs commit'.
70 You will be put in an editor to make a message that describes the
71 changes that you have made (for future reference). Your changes
72 will then be added to the central copy.
74 ADDING AND REMOVING FILES
76 It can be that the changes you want to make involve a completely
77 new file, or removing an existing one. The commands to use here
83 You still have to do a commit after these commands. You may make
84 any number of new files in your copy of the repository, but they
85 will not be committed to the central copy unless you do a 'cvs add'.
87 OTHER USEFUL COMMANDS AND HINTS
89 To see the commit messages for files, and who made them, use:
93 To see the differences between your version and the central version:
97 To give a file a new name, rename it and do an add and a remove.
99 To lose your changes and go back to the version from the
100 repository, delete the file and do an update.
102 After an update where there have been clashes, your original
103 version of the file is saved as .#file.version.
105 All the cvs commands mentioned accept a flag '-n', that doesn't do
106 the action, but lets you see what would happen. For instance, you
107 can use 'cvs -n update' to see which files would be updated.
111 This is necessarily a very brief introduction. See the manual page
112 (man cvs) for full details.