<div id="Branches-and-revisions"></div>
<div class="header">
<p>
Next: [[cvs: Magic branch numbers#Magic branch numbers|Magic branch numbers]], Previous: [[cvs: Accessing branches#Accessing branches|Accessing branches]], 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="Branches-and-revisions-1"></div>
=== Branches and revisions ===
<div id="index-Branch-number-1"></div>
<div id="index-Number_002c-branch-1"></div>
<div id="index-Revision-numbers-_0028branches_0029"></div>

Ordinarily, a file&rsquo;s revision history is a linear
series of increments (see [[cvs: Revision numbers#Revision numbers|Revision numbers]]):

<div class="example" style="margin-left: 3.2em">
        +-----+    +-----+    +-----+    +-----+    +-----+
        ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 !
        +-----+    +-----+    +-----+    +-----+    +-----+
</div>

However, <small>CVS</small> is not limited to linear development.  The
<em>revision tree</em> can be split into <em>branches</em>,
where each branch is a self-maintained line of
development.  Changes made on one branch can easily be
moved back to the main trunk.

Each branch has a <em>branch number</em>, consisting of an
odd number of period-separated decimal integers.  The
branch number is created by appending an integer to the
revision number where the corresponding branch forked
off.  Having branch numbers allows more than one branch
to be forked off from a certain revision.

All revisions on a branch have revision numbers formed
by appending an ordinal number to the branch number.
The following figure illustrates branching with an
example.

<div class="example" style="margin-left: 3.2em">
                                                       +-------------+
                            Branch 1.2.2.3.2 -&gt;        ! 1.2.2.3.2.1 !
                                                     / +-------------+
                                                    /
                                                   /
                  +---------+    +---------+    +---------+
 Branch 1.2.2 -&gt; _! 1.2.2.1 !----! 1.2.2.2 !----! 1.2.2.3 !
                / +---------+    +---------+    +---------+
               /
              /
 +-----+    +-----+    +-----+    +-----+    +-----+
 ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 !  &lt;- The main trunk
 +-----+    +-----+    +-----+    +-----+    +-----+
                 !
                 !
                 !   +---------+    +---------+    +---------+
 Branch 1.2.4 -&gt; +---! 1.2.4.1 !----! 1.2.4.2 !----! 1.2.4.3 !
                     +---------+    +---------+    +---------+
 
</div>



The exact details of how the branch number is
constructed is not something you normally need to be
concerned about, but here is how it works: When
<small>CVS</small> creates a branch number it picks the first
unused even integer, starting with 2.  So when you want
to create a branch from revision 6.4 it will be
numbered 6.4.2.  All branch numbers ending in a zero
(such as 6.4.0) are used internally by <small>CVS</small>
(see [[cvs: Magic branch numbers#Magic branch numbers|Magic branch numbers]]).  The branch 1.1.1 has a
special meaning.  See [[cvs: Tracking third-party sources#Tracking third-party sources|Tracking sources]].


----

<div class="header">
<p>
Next: [[cvs: Magic branch numbers#Magic branch numbers|Magic branch numbers]], Previous: [[cvs: Accessing branches#Accessing branches|Accessing branches]], Up: [[cvs: Branching and merging#Branching and merging|Branching and merging]] &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>].
