blob: 31e2c1475310554dcee49da348d5334faef51709 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<HEAD>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<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>Version control life cycle: adding and ignoring resources</title>
<meta name="keyword" content="team">
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js" type="text/javascript"> </script>
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1 CLASS="Head">Version control life cycle: adding and ignoring resources</H1>
<p>When committing resources, often there are resources that you do not want to
store in the repository. For example, external editors might create temporary
files in your project, compilation of .java files might create .class files,
or some build operations might result in binary files. When put together, these
generated files may be quite large. They may also be regenerated whenever
a build is performed, resulting in many outgoing changes. Typically these are
not files that one wants to persist in the repository or to share with other
members of a team.
</p>
<p>Team CVS has two related tasks that allow you to control which files are stored
in the repository: adding a resource to version control, and ignoring a resource.
</p>
<h2>Adding a file to version control</h2>
<p>Team CVS does not automatically add files to version control. Rather, it's
your choice to explicitly add files to version control. This is accomplished
by selecting the <b>Team &gt; Add to Version Control</b> menu.
</p>
<p>When performed on a file, it will add that file to version control. The result
is that the CVS repository immediately creates an entry so that it can
start maintaining history state for that file. This occurs even before you commit
the file to the repository.
</p>
<p>When adding a folder or project, the action will recursively descend into sub-folders,
adding those files it finds to version control, provided the files have not
been explicitly ignored. </p>
<p><em>Tip:</em> When committing files, if the selection either directly or recursively
contains files which have not been added to version control, you will be prompted
whether or not you want them added. This is a convenience function to help ensure
that you do not miss committing new resources which were unintentionally never
added. </p>
<h2><i>How may I ignore thee, let me count the ways</i></h2>
<P>There are several facilities that allow you to specify which resources should
be excluded from version control:
</P>
<ol>
<li>There is a global preference which you can use for ignoring files and directories
that match a certain filename pattern. For example, if you create a global
ignore for <samp>/bin</samp>, and any resource that matches &quot;bin&quot;
in any directory in the workspace will be ignored for version control. Use the
<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.team.ui.IgnorePreferences)")'>
<img src="PLUGINS_ROOT/org.eclipse.help/command_link.svg" alt="command link">
<b>Team &gt; Ignored Resources</b></a>
preference page to globally exclude resources from version control.</li>
<li>Any resource marked as <i>derived</i> will be automatically ignored for
version management by Team CVS. Some builders, such as the Java builder, mark
all of its build output (e.g. .class files) as derived.</li>
<li>CVS supports the creation of a special <i>.cvsignore</i> file whose contents
describe which files or folders to ignore for version management. The .cvsignore
file only applies the pattern to resources in the <i> same</i> directory as
the .cvsignore file itself.</li>
</ol>
<P><em>Tip</em>: Once a resource is under version control, it cannot be
subsequently ignored easily. This is why you must invoke an explicit command
to add resources to version control.
</P>
<p><img border="0" src="../images/ngrelc.png" alt="Related concepts" ><br>
<a href="../concepts/concepts-26.htm">Team programming with CVS</a><br>
</p>
<p><img border="0" src="../images/ngrelt.png" alt="Related tasks" ><br>
<a href="tasks-100d1.htm">Creating a global ignore pattern</a><br>
<a href="tasks-100d2.htm">Authoring the CVS .cvsignore file</a><br>
<a href="tasks-114.htm">Committing</a><br>
<a href="tasks-113.htm">Updating</a>
</p>
</BODY>
</HTML>