blob: d1c5ac9753bcd4cde9f20793368b8498604204dc [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<title>Authoring the CVS .cvsignore file</title>
<meta name="keyword" content="team">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1 CLASS="Head">Authoring the CVS .cvsignore file</H1>
<P>When committing resources, often there are resources that you do not want to
add to version control. One way you can do this is by using the CVS &quot;ignore&quot;
facility, which reads the contents of the file <i>.cvsignore</i> to determine
what to ignore.</P>
<P>The <i>.cvsignore</i> file can be added to any directory of a project. Many
existing CVS projects already contain several of these files. This text file
consists of a list of files, directories, or patterns.
</P>
<P>For example, to add a .cvsignore file to ignore the entire bin directory of
an existing project:
</P>
<ol>
<li>In the Navigator view, select a project that contains a /bin directory.
The bin directory will commonly contain the projects build output. These are
files that are generated from the project's source files and are usually not
version-controlled.</li>
<li>From the pop-up menu for the project, select <b> New &gt; File</b>.&nbsp;</li>
<li>Type <i>.</i><samp>cvsignore</samp> as the file name, then press <b>Finish</b>.
The file will be created in your project's root directory. You should see
it in the Navigator view.</li>
<li>Enter <samp>bin</samp> in the .cvsignore file and save it.</li>
<li>Select the project.&nbsp; From the context menu, select the <b> Team &gt;
Synchronize with Repository</b> menu item.&nbsp; Notice that the bin directory
does not show as an outgoing change. It is ignored.</li>
</ol>
<P>The cvsignore file consists of a list of files, directories, or patterns.
In a similar way to the global ignore facility, the wildcards * and ? may be
present in any entry in the .cvsignore file. Any file or sub-directory
<i>in the current directory</i> that matches any one of the patterns will
be ignored.
</P>
<p><b>Tip:</b> In the Team menu and in the Synchronize view resource context menu there is a menu item (<b>Add to .cvsignore</b>)
for adding a file pattern
to the appropriate .cvsignore file. This menu item is enabled for resources that are not yet under CVS version
control.
</p>
<p><img border="0" src="../images/ngrelc.gif" alt="Related concepts" width="159" height="27"><br>
<a href="../concepts/concepts-26.htm">Team programming with CVS</a><br>
</p>
<p><img border="0" src="../images/ngrelt.gif" alt="Related tasks" width="159" height="27"><br>
<a href="tasks-115.htm">Synchronizing with the repository</a><br>
<a href="tasks-100d.htm">Version control life cycle: adding and ignoring resources</a><br>
<a href="tasks-100d1.htm">Creating a global ignore pattern</a>
</p>
<p><img border="0" src="../images/ngrelr.gif" alt="Related reference" width="159" height="27"><br>
<a href="http://www.cvshome.org/docs/manual/cvs_18.html#SEC175" target="_blank">www.cvshome.org: Ignoring files via cvsignore</a>
</p>
<p>&nbsp;<br>
<a href="../hglegal2003.htm"><img src="../images/ngibmcpy2003.gif" alt="Copyright IBM Corporation and others 2000, 2003" border="0" width="324" height="14"></a>
</p>
</BODY>
</HTML>