117721SpeterDate: Tue, 16 Jun 1992 17:05:23 +0200
217721SpeterFrom: Steven.Pemberton@cwi.nl
317721SpeterMessage-Id: <9206161505.AA06927.steven@sijs.cwi.nl>
417721SpeterTo: berliner@Sun.COM
517721SpeterSubject: cvs
617721Speter
717721SpeterINTRODUCTION TO USING CVS
817721Speter
917721Speter    CVS is a system that lets groups of people work simultaneously on
1017721Speter    groups of files (for instance program sources).
1117721Speter
1217721Speter    It works by holding a central 'repository' of the most recent version
1317721Speter    of the files.  You may at any time create a personal copy of these
1417721Speter    files; if at a later date newer versions of the files are put in the
1517721Speter    repository, you can 'update' your copy.
1617721Speter
1717721Speter    You may edit your copy of the files freely. If new versions of the
1817721Speter    files have been put in the repository in the meantime, doing an update
1917721Speter    merges the changes in the central copy into your copy.
2017721Speter	(It can be that when you do an update, the changes in the
2117721Speter	central copy clash with changes you have made in your own
2217721Speter	copy. In this case cvs warns you, and you have to resolve the
2317721Speter	clash in your copy.)
2417721Speter
2517721Speter    When you are satisfied with the changes you have made in your copy of
2617721Speter    the files, you can 'commit' them into the central repository.
2717721Speter	(When you do a commit, if you haven't updated to the most
2817721Speter	recent version of the files, cvs tells you this; then you have
2917721Speter	to first update, resolve any possible clashes, and then redo
3017721Speter	the commit.)
3117721Speter
3217721SpeterUSING CVS
3317721Speter
3417721Speter    Suppose that a number of repositories have been stored in
3517721Speter    /usr/src/cvs. Whenever you use cvs, the environment variable
3617721Speter    CVSROOT must be set to this (for some reason):
3717721Speter
3817721Speter	CVSROOT=/usr/src/cvs
3917721Speter	export CVSROOT
4017721Speter
4117721SpeterTO CREATE A PERSONAL COPY OF A REPOSITORY
4217721Speter
4317721Speter    Suppose you want a copy of the files in repository 'views' to be
4417721Speter    created in your directory src. Go to the place where you want your
4517721Speter    copy of the directory, and do a 'checkout' of the directory you
4617721Speter    want:
4717721Speter
4817721Speter	cd $HOME/src
4917721Speter	cvs checkout views
5017721Speter
5117721Speter    This creates a directory called (in this case) 'views' in the src
5217721Speter    directory, containing a copy of the files, which you may now work
5317721Speter    on to your heart's content.
5417721Speter
5517721SpeterTO UPDATE YOUR COPY
5617721Speter
5717721Speter    Use the command 'cvs update'.
5817721Speter
5917721Speter    This will update your copy with any changes from the central
6017721Speter    repository, telling you which files have been updated (their names
6117721Speter    are displayed with a U before them), and which have been modified
6217721Speter    by you and not yet committed (preceded by an M). You will be
6317721Speter    warned of any files that contain clashes, the clashes will be
6417721Speter    marked in the file surrounded by lines of the form <<<< and >>>>.
6517721Speter   
6617721SpeterTO COMMIT YOUR CHANGES
6717721Speter
6817721Speter    Use the command 'cvs commit'.
6917721Speter
7017721Speter    You will be put in an editor to make a message that describes the
7117721Speter    changes that you have made (for future reference). Your changes
7217721Speter    will then be added to the central copy.
7317721Speter
7417721SpeterADDING AND REMOVING FILES
7517721Speter
7617721Speter    It can be that the changes you want to make involve a completely
7717721Speter    new file, or removing an existing one. The commands to use here
7817721Speter    are:
7917721Speter
8017721Speter	cvs add <filename>
8117721Speter	cvs remove <filename>
8217721Speter
8317721Speter    You still have to do a commit after these commands. You may make
8417721Speter    any number of new files in your copy of the repository, but they
8517721Speter    will not be committed to the central copy unless you do a 'cvs add'.
8617721Speter
8717721SpeterOTHER USEFUL COMMANDS AND HINTS
8817721Speter
8917721Speter    To see the commit messages for files, and who made them, use:
9017721Speter
9117721Speter	cvs log [filenames]
9217721Speter
9317721Speter    To see the differences between your version and the central version:
9417721Speter
9517721Speter	cvs diff [filenames]
9617721Speter
9717721Speter    To give a file a new name, rename it and do an add and a remove.
9817721Speter
9917721Speter    To lose your changes and go back to the version from the
10017721Speter    repository, delete the file and do an update.
10117721Speter
10217721Speter    After an update where there have been clashes, your original
10317721Speter    version of the file is saved as .#file.version.
10417721Speter
10517721Speter    All the cvs commands mentioned accept a flag '-n', that doesn't do
10617721Speter    the action, but lets you see what would happen. For instance, you
10717721Speter    can use 'cvs -n update' to see which files would be updated.
10817721Speter
10917721SpeterMORE INFORMATION
11017721Speter
11117721Speter    This is necessarily a very brief introduction. See the manual page
11217721Speter    (man cvs) for full details.
113