xref: /openbsd-src/usr.bin/cvs/cvsintro.7 (revision b67b73611ec4ec6ed33e4aacef06c5a181d1bc98)
1*b67b7361Sschwarze.\"	$OpenBSD: cvsintro.7,v 1.16 2018/12/05 15:34:52 schwarze Exp $
2ebf684d0Sjfb.\"
3ebf684d0Sjfb.\" Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
4ebf684d0Sjfb.\" All rights reserved.
5ebf684d0Sjfb.\"
6ebf684d0Sjfb.\" Redistribution and use in source and binary forms, with or without
7ebf684d0Sjfb.\" modification, are permitted provided that the following conditions
8ebf684d0Sjfb.\" are met:
9ebf684d0Sjfb.\"
10ebf684d0Sjfb.\" 1. Redistributions of source code must retain the above copyright
11ebf684d0Sjfb.\"    notice, this list of conditions and the following disclaimer.
12ebf684d0Sjfb.\" 2. The name of the author may not be used to endorse or promote products
13ebf684d0Sjfb.\"    derived from this software without specific prior written permission.
14ebf684d0Sjfb.\"
15ebf684d0Sjfb.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
16ebf684d0Sjfb.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17ebf684d0Sjfb.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
18ebf684d0Sjfb.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19ebf684d0Sjfb.\" EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20ebf684d0Sjfb.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21ebf684d0Sjfb.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22ebf684d0Sjfb.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23ebf684d0Sjfb.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24ebf684d0Sjfb.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25ebf684d0Sjfb.\"
26*b67b7361Sschwarze.Dd $Mdocdate: December 5 2018 $
27ebf684d0Sjfb.Dt CVSINTRO 7
28ebf684d0Sjfb.Os
29ebf684d0Sjfb.Sh NAME
30ebf684d0Sjfb.Nm cvsintro
31ebf684d0Sjfb.Nd introduction to Concurrent Versioning System
32ebf684d0Sjfb.Sh DESCRIPTION
33ebf684d0SjfbConcurrent Versions System is a popular open source version control system.
34ebf684d0SjfbAlthough it is mostly used to track changes to software source code for
35ebf684d0Sjfbdevelopment teams, there are very few limitations to the kind of data that
36ebf684d0Sjfbcan be managed by the system, and it can be used for document archival
37ebf684d0Sjfbpurposes as well.
38ebf684d0Sjfb.Pp
39ebf684d0SjfbThis document provides an introduction to using OpenCVS to manage repositories.
40ebf684d0SjfbIt will first cover some of the aspects of using and managing CVS and,
41ebf684d0Sjfbwhere appropriate, explain the main differences between OpenCVS and other
42ebf684d0Sjfbdistributions.
43efb2138eSjmc.Sh USING CVS TO TRACK SOURCE CHANGES
44efb2138eSjmcOne of the most common uses of
45efb2138eSjmc.Xr cvs 1
46efb2138eSjmcis to track changes to a collection of source files (a
47efb2138eSjmc.Em module )
48efb2138eSjmccontained within a certain, defined, location (a
49efb2138eSjmc.Em repository ) .
50efb2138eSjmcThis allows the user to keep a set of local sources in sync
51efb2138eSjmcwith a set of remote sources.
52efb2138eSjmcIt also allows the user to view information about changes to the repository
53efb2138eSjmc(such as what the exact change was, who made it, and when),
54efb2138eSjmcto view and compare information about different versions of a file,
55efb2138eSjmcand possibly to make local changes to files.
56efb2138eSjmc.Pp
57efb2138eSjmcAs an example,
58efb2138eSjmcwe'll look at a user wishing to track source changes to the
59efb2138eSjmc.Ox
60efb2138eSjmctree,
61efb2138eSjmcmaintaining a local (personal) copy of the source on their own machine.
62efb2138eSjmcThe user will have to decide:
63efb2138eSjmc.Bl -bullet
64efb2138eSjmc.It
65d282b004SxsaThe CVS server to use.
66efb2138eSjmcThere may be only one server or, for larger projects,
67efb2138eSjmca number of mirror servers.
68efb2138eSjmc.It
69efb2138eSjmcWhere the source module(s) will be kept on the local machine.
70efb2138eSjmc.El
71efb2138eSjmc.Pp
72efb2138eSjmcIn our example, the
73efb2138eSjmc.Ox
74efb2138eSjmcproject, there are a large number of servers to choose from.
7519b92625SderaadtIt's generally better to use a server that is geographically closer
76efb2138eSjmcsince this tends to be faster and less of a strain for the master server.
77efb2138eSjmcUtilities such as
78efb2138eSjmc.Xr ping 8
79efb2138eSjmcand
80efb2138eSjmc.Xr traceroute 8
81efb2138eSjmccan be used to decide which host will be best to use.
82efb2138eSjmcSecondly, the local repository has to be stored somewhere.
83efb2138eSjmc.Ox
84efb2138eSjmcuses
85efb2138eSjmc.Pa /usr/src
86efb2138eSjmcas the default location for its source tree
87efb2138eSjmc(the
88efb2138eSjmc.Dq src
89efb2138eSjmcmodule),
90efb2138eSjmcbut this is largely arbitrary.
91efb2138eSjmc.Pp
92efb2138eSjmcThis example shows how a user initially checks out a copy of the source tree
93efb2138eSjmcfrom local mirror anoncvs.nl.openbsd.org:
94efb2138eSjmc.Bd -literal -offset indent
95efb2138eSjmc$ cd /usr
96c6073d6cSxsa$ cvs -d anoncvs@anoncvs.nl.openbsd.org:/cvs checkout -P src
97efb2138eSjmc.Ed
98efb2138eSjmc.Pp
99efb2138eSjmcIn this case it was first necessary to add ourselves to the
100efb2138eSjmc.Dq wsrc
101efb2138eSjmcgroup, since
102efb2138eSjmc.Pa /usr/src
103efb2138eSjmcis writable only by user
104efb2138eSjmc.Dq root
105efb2138eSjmcand/or group
106efb2138eSjmc.Dq wsrc .
107efb2138eSjmcThe
108efb2138eSjmc.Fl d
109efb2138eSjmcoption was necessary to tell
110efb2138eSjmc.Xr cvs 1
111efb2138eSjmcthe location of the remote server.
112efb2138eSjmcNote the
113efb2138eSjmc.Dq :/cvs
114efb2138eSjmcstring appended to the server's address:
115efb2138eSjmcthe path to the repository
116efb2138eSjmc.Em must
117efb2138eSjmcbe specified.
118efb2138eSjmcFinally the
119efb2138eSjmc.Ic checkout
120efb2138eSjmccommand was used to obtain a copy of the module
121efb2138eSjmc.Dq src .
122efb2138eSjmc.Pp
123efb2138eSjmcNote that the above example simply checked out
124efb2138eSjmc.Ox Ns -current :
125efb2138eSjmcoften different software versions are available:
126efb2138eSjmcuse an identifier
127efb2138eSjmc.Pq Em tag
128efb2138eSjmcto specify which version to check out.
129efb2138eSjmc.Pp
130efb2138eSjmcThereafter the user is free to manipulate the source tree
131efb2138eSjmcusing the
132efb2138eSjmc.Xr cvs 1
133efb2138eSjmcutility itself.
134efb2138eSjmcFor example, the following would update (sync) the local copy of
135efb2138eSjmc.Dq src
136efb2138eSjmcwith the remote copy:
137efb2138eSjmc.Bd -literal -offset indent
138efb2138eSjmc$ cd /usr/src
139efb2138eSjmc$ cvs -d anoncvs@anoncvs.nl.openbsd.org:/cvs update -Pd
140efb2138eSjmc.Ed
141efb2138eSjmc.Pp
142efb2138eSjmcGeneral users may wish to use
143efb2138eSjmc.Xr cvs 1
144efb2138eSjmcsimply to keep a copy of sources up to date with a development tree;
145efb2138eSjmcdevelopers of software projects can also use
146efb2138eSjmc.Xr cvs 1
147efb2138eSjmcto make their own changes to a set of remote source files,
148efb2138eSjmcand to view changes made by other software developers.
149efb2138eSjmc.Pp
150efb2138eSjmcSee
151efb2138eSjmc.Xr cvs 1
152efb2138eSjmcfor more information on the different commands available.
15325ad5222SjmcSee the entry for
15425ad5222Sjmc.Pa $HOME/.cvsrc
15525ad5222Sjmcin
15625ad5222Sjmc.Xr cvs 5
157efb2138eSjmcfor details on configuring
158efb2138eSjmc.Xr cvs 1
159efb2138eSjmcitself.
160efb2138eSjmc.Sh USING CVS TO MANAGE A REPOSITORY
161efb2138eSjmcSoftware developers may wish to use
162efb2138eSjmc.Xr cvs 1
163efb2138eSjmcto manage their own software projects.
164efb2138eSjmcHere we look at an example usage:
165efb2138eSjmcproviding remote access to a small group of developers
166efb2138eSjmcworking on project
167efb2138eSjmc.Dq foo ,
168efb2138eSjmclocated in
169efb2138eSjmc.Pa /cvs/projects .
170efb2138eSjmcFirst of all a
171efb2138eSjmc.Em repository
172efb2138eSjmchas to be created.
173efb2138eSjmcA repository is just the location of the group of files
174efb2138eSjmcto be managed.
175efb2138eSjmcWithin the repository,
176efb2138eSjmcfiles may be organised into collections of files,
177efb2138eSjmccalled
178efb2138eSjmc.Em modules ,
179efb2138eSjmcwhich are just logical groupings of files.
180efb2138eSjmc.Pp
181efb2138eSjmcIn our example, module
182efb2138eSjmc.Dq foo
183efb2138eSjmcis located at
184efb2138eSjmc.Pa /cvs/projects/foo
185efb2138eSjmcon machine
186efb2138eSjmc.Dq cvs.example.org .
187efb2138eSjmcTherefore
188efb2138eSjmc.Pa /cvs/projects
189efb2138eSjmcis both the root directory
190efb2138eSjmc.Pq Em $CVSROOT
191efb2138eSjmcof our repository and the name of our repository.
192efb2138eSjmc.Pp
193efb2138eSjmcIf a set of source files already exist,
194efb2138eSjmcpossibly already under revision control,
195efb2138eSjmcthey can be added to a repository using the
196efb2138eSjmc.Xr cvs 1
197efb2138eSjmccommand
198efb2138eSjmc.Ic import .
1994d46fc3aSnialloThis is a useful way of adding modules to a pre-existing repository.
200efb2138eSjmcIn our example we are starting from scratch,
201efb2138eSjmcso the repository has to be initialised using the
202efb2138eSjmc.Ic init
203efb2138eSjmccommand:
204efb2138eSjmc.Bd -literal -offset indent
205efb2138eSjmc# cd /cvs/projects
206efb2138eSjmc# cvs -d /cvs/projects init
207efb2138eSjmc.Ed
208efb2138eSjmc.Pp
209efb2138eSjmcThis will create a default administrative directory,
210efb2138eSjmc.Pa $CVSROOT/CVSROOT ,
211efb2138eSjmcfilled with files concerned with the management of the repository.
212efb2138eSjmc.Pp
213efb2138eSjmcThereafter, access will have to be arranged for
214efb2138eSjmcdevelopers participating in the project.
215efb2138eSjmcThis typically means providing SSH access via
216efb2138eSjmc.Xr sshd 8
217efb2138eSjmcfor remote access,
218efb2138eSjmcunless the development network is local.
219ebf684d0Sjfb.Sh SEE ALSO
2208787c242Sxsa.Xr cvs 1 ,
221a73a2907Sjmc.Xr rcs 1 ,
222a7bff744Sjmc.Xr cvs 5 ,
223efb2138eSjmc.Xr sshd 8
224a73a2907Sjmc.Sh HISTORY
225*b67b7361SschwarzeThe OpenCVS project is a BSD-licensed rewrite of the original
226a73a2907SjmcConcurrent Versioning System written by Jean-Francois Brousseau.
227a73a2907SjmcThe original CVS code was written in large parts by Dick Grune,
228a73a2907SjmcBrian Berliner, and Jeff Polk.
229a73a2907Sjmc.Sh AUTHORS
230a73a2907Sjmc.An Jean-Francois Brousseau
231ebf684d0Sjfb.Sh CAVEATS
232ebf684d0SjfbThis CVS implementation does not fully conform to the GNU CVS version.
233ebf684d0SjfbIn some cases, this was done explicitly because GNU CVS has inconsistencies
234ebf684d0Sjfbor ambiguous behaviour.
235ebf684d0SjfbSome things have also been left out or modified to enhance the overall
236ebf684d0Sjfbsecurity of the system.
237ebf684d0Sjfb.Pp
238ebf684d0SjfbAmong other things, support for the pserver connection mechanism has been
239ebf684d0Sjfbdropped because of security issues with the authentication mechanism.
240