<div id="From-files"></div>
<div class="header">
<p>
Next: [[cvs: Creating Files From Other Version Control Systems#Creating Files From Other Version Control Systems|From other version control systems]], Up: [[cvs: Setting up the files#Setting up the files|Setting up the files]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="Creating-a-directory-tree-from-a-number-of-files"></div>
==== Creating a directory tree from a number of files ====
<div id="index-Importing-files"></div>

When you begin using <small>CVS</small>, you will probably already have several
projects that can be
put under <small>CVS</small> control.  In these cases the easiest way is to use the
<code>import</code> command.  An example is probably the easiest way to
explain how to use it.  If the files you want to install in
<small>CVS</small> reside in &lsquo;<tt><var>wdir</var></tt>&rsquo;, and you want them to appear in the
repository as &lsquo;<tt>$CVSROOT/yoyodyne/<var>rdir</var></tt>&rsquo;, you can do this:

<div class="example" style="margin-left: 3.2em">
 $ cd <var>wdir</var>
 $ cvs import -m &quot;Imported sources&quot; yoyodyne/<var>rdir</var> yoyo start
</div>

Unless you supply a log message with the &lsquo;<code>-m</code>&rsquo;
flag, <small>CVS</small> starts an editor and prompts for a
message.  The string &lsquo;<code>yoyo</code>&rsquo; is a <em>vendor tag</em>,
and &lsquo;<code>start</code>&rsquo; is a <em>release tag</em>.  They may fill
no purpose in this context, but since <small>CVS</small> requires
them they must be present.  See [[cvs: Tracking third-party sources#Tracking third-party sources|Tracking sources]], for
more information about them.

You can now verify that it worked, and remove your
original source directory.

<div class="example" style="margin-left: 3.2em">
 $ cd ..
 $ cvs checkout yoyodyne/<var>rdir</var>       # <span class="roman" style="font-family:serif; font-weight:normal">Explanation below</span>
 $ diff -r <var>wdir</var> yoyodyne/<var>rdir</var>
 $ rm -r <var>wdir</var>
</div>

Erasing the original sources is a good idea, to make sure that you do
not accidentally edit them in <var>wdir</var>, bypassing <small>CVS</small>.
Of course, it would be wise to make sure that you have
a backup of the sources before you remove them.

The <code>checkout</code> command can either take a module
name as argument (as it has done in all previous
examples) or a path name relative to <code>$CVSROOT</code>,
as it did in the example above.

It is a good idea to check that the permissions
<small>CVS</small> sets on the directories inside <code>$CVSROOT</code>
are reasonable, and that they belong to the proper
groups.  See [[cvs: File permissions#File permissions|File permissions]].

If some of the files you want to import are binary, you
may want to use the wrappers features to specify which
files are binary and which are not.  See [[cvs: The cvswrappers file#The cvswrappers file|Wrappers]].


----

<div class="header">
<p>
Next: [[cvs: Creating Files From Other Version Control Systems#Creating Files From Other Version Control Systems|From other version control systems]], Up: [[cvs: Setting up the files#Setting up the files|Setting up the files]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
