<div id="Merging-adds-and-removals"></div>
<div class="header">
<p>
Next: [[cvs: Merging and keywords#Merging and keywords|Merging and keywords]], Previous: [[cvs: Merging differences between any two revisions#Merging differences between any two revisions|Merging two revisions]], Up: [[cvs: Branching and merging#Branching and merging|Branching and merging]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="Merging-can-add-or-remove-files"></div>
=== Merging can add or remove files ===

If the changes which you are merging involve removing
or adding some files, <code>update -j</code> will reflect
such additions or removals.

For example:
<div class="example" style="margin-left: 3.2em">
 cvs update -A
 touch a b c
 cvs add a b c ; cvs ci -m &quot;added&quot; a b c
 cvs tag -b branchtag
 cvs update -r branchtag
 touch d ; cvs add d
 rm a ; cvs rm a
 cvs ci -m &quot;added d, removed a&quot;
 cvs update -A
 cvs update -jbranchtag
</div>

After these commands are executed and a &lsquo;<code>cvs commit</code>&rsquo; is done,
file &lsquo;<tt>a</tt>&rsquo; will be removed and file &lsquo;<tt>d</tt>&rsquo; added in the main branch.

Note that using a single static tag (&lsquo;<code>-j <var>tagname</var></code>&rsquo;)
rather than a dynamic tag (&lsquo;<code>-j <var>branchname</var></code>&rsquo;) to merge
changes from a branch will usually not remove files which were removed on the
branch since <small>CVS</small> does not automatically add static tags to dead revisions.
The exception to this rule occurs when
a static tag has been attached to a dead revision manually.  Use the branch tag
to merge all changes from the branch or use two static tags as merge endpoints
to be sure that all intended changes are propagated in the merge.

This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
