Differences between version 11 and predecessor to the previous major change of CVS.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 11 | Last edited on Monday, May 31, 2004 12:24:33 pm | by JohnMcPherson | Revert |
Older page: | version 10 | Last edited on Saturday, February 28, 2004 5:15:51 pm | by ReedLoden | Revert |
@@ -18,16 +18,69 @@
Coriolis Open Press [Open Source Development with CVS|http://cvsbook.red-bean.com/]. Its not all the chapters, but its the relevant ones. The non-free chapters regard the philosophy behind cvs in open source, or something. Direct link to [postscript|http://cvsbook.red-bean.com/cvsbook.ps] and [html|http://cvsbook.red-bean.com/cvsbook.html.gz]. [Online|http://cvsbook.red-bean.com/cvsbook.html] copy.
----
+!!Setting up a local CVS repository
+
+If the machine does not have a repository set up, you need to decide where to store the modules, and create a skeleton.
+This will create a "CVSROOT" directory.
+
+ CVSROOT=/path/to/some/directory
+ export CVSROOT
+ # create an initial skeleton
+ cvs init
+
+Now, to import a source code module and store it in the repository:
+ # change into the directory containing files and dirs to import
+ cd source/code/topdir
+ # set the path to the cvs repository. /var/lib/cvs/ might be a good
+ # place for a multiuser system, or in your home directory for just
+ # yourself (eg "mkdir ~/cvs"; CVSROOT=~/cvs).
+ CVSROOT=/path/to/some/directory
+ export CVSROOT
+ # add the files in the current directory to a new module repository
+ # the name for this module. This will be the directory name, so
+ # probably a good idea to not have spaces in it.
+ MODULENAME="report"
+ # a string to identify the original source
+ VENDORTAG="original upstream"
+ # a tag (string) to mark your initial versions of the files
+ RELEASETAG="initial"
+ cvs import "$MODULENAME" "$VENDORTAG" "$RELEASETAG"
+
+(the editor specified in your EDITOR or VISUAL environment variable will
+then open, asking for a comment. Just put "initial version" or something)
+
+This will create a new directory, like $CSVROOT/$MODULENAME.
+Note that this only sets up a module, and doesn't touch your current directory.
+You will need to check out the module, as below.
+
+----
+!!Using a CVS repository/module
+
there are 3 commands you need to understand to use cvs:
# cvs checkout
# cvs update
# cvs commit
:)
(There are a few other commands you need if you want to set up a repository, but the above are all you need to get code out of and into an existing repository).
+
+To use the module created in the above section:
+ # decide where you want to check out the code
+ cd ~/src
+ # tell cvs where the repository is
+ CVSROOT=/path/to/some/directory
+ export CVSROOT
+ # get the code from a module. In this case, the module named "report"
+ cvs checkout report
+ # go into the newly created directory
+ cd report
+
+Note that cvs also takes a "-d" argument for directory, so you can do
+ cvs -d /path/to/some/directory checkout report
+instead of setting the CVSROOT environment variable.
----
Here are some examples from the [Greenstone|http://greenstone.org] source code. (GreenStone is [GPL]'d digital library management software from the Computer Science department at WaikatoUniversity).