1<div id="Merging-adds-and-removals"></div>
2<div class="header">
3<p>
4Next: [[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>
5</div>
6
7----
8
9<div id="Merging-can-add-or-remove-files"></div>
10=== Merging can add or remove files ===
11
12If the changes which you are merging involve removing
13or adding some files, <code>update -j</code> will reflect
14such additions or removals.
15
16For example:
17<div class="example" style="margin-left: 3.2em">
18 cvs update -A
19 touch a b c
20 cvs add a b c ; cvs ci -m &quot;added&quot; a b c
21 cvs tag -b branchtag
22 cvs update -r branchtag
23 touch d ; cvs add d
24 rm a ; cvs rm a
25 cvs ci -m &quot;added d, removed a&quot;
26 cvs update -A
27 cvs update -jbranchtag
28</div>
29
30After these commands are executed and a &lsquo;<code>cvs commit</code>&rsquo; is done,
31file &lsquo;<tt>a</tt>&rsquo; will be removed and file &lsquo;<tt>d</tt>&rsquo; added in the main branch.
32
33Note that using a single static tag (&lsquo;<code>-j <var>tagname</var></code>&rsquo;)
34rather than a dynamic tag (&lsquo;<code>-j <var>branchname</var></code>&rsquo;) to merge
35changes from a branch will usually not remove files which were removed on the
36branch since <small>CVS</small> does not automatically add static tags to dead revisions.
37The exception to this rule occurs when
38a static tag has been attached to a dead revision manually.  Use the branch tag
39to merge all changes from the branch or use two static tags as merge endpoints
40to be sure that all intended changes are propagated in the merge.
41
42This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
43