1<div id="Creating-a-branch"></div> 2<div class="header"> 3<p> 4Next: [[cvs: Accessing branches#Accessing branches|Accessing branches]], Previous: [[cvs: What branches are good for#What branches are good for|Branches motivation]], Up: [[cvs: Branching and merging#Branching and merging|Branching and merging]] |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p> 5</div> 6 7---- 8 9<div id="Creating-a-branch-1"></div> 10=== Creating a branch === 11<div id="index-Creating-a-branch"></div> 12<div id="index-Branch_002c-creating-a"></div> 13<div id="index-tag-_0028subcommand_0029_002c-creating-a-branch-using"></div> 14<div id="index-rtag-_0028subcommand_0029_002c-creating-a-branch-using"></div> 15 16You can create a branch with <code>tag -b</code>; for 17example, assuming you’re in a working copy: 18 19<div class="example" style="margin-left: 3.2em"> 20 $ cvs tag -b rel-1-0-patches 21</div> 22 23 24This splits off a branch based on the current revisions 25in the working copy, assigning that branch the name 26‘<code>rel-1-0-patches</code>’. 27 28It is important to understand that branches get created 29in the repository, not in the working copy. Creating a 30branch based on current revisions, as the above example 31does, will ''not'' automatically switch the working 32copy to be on the new branch. For information on how 33to do that, see [[cvs: Accessing branches#Accessing branches|Accessing branches]]. 34 35You can also create a branch without reference to any 36working copy, by using <code>rtag</code>: 37 38<div class="example" style="margin-left: 3.2em"> 39 $ cvs rtag -b -r rel-1-0 rel-1-0-patches tc 40</div> 41 42‘<code>-r rel-1-0</code>’ says that this branch should be 43rooted at the revision that 44corresponds to the tag ‘<code>rel-1-0</code>’. It need not 45be the most recent revision – it’s often useful to 46split a branch off an old revision (for example, when 47fixing a bug in a past release otherwise known to be 48stable). 49 50As with ‘<code>tag</code>’, the ‘<code>-b</code>’ flag tells 51<code>rtag</code> to create a branch (rather than just a 52symbolic revision name). Note that the numeric 53revision number that matches ‘<code>rel-1-0</code>’ will 54probably be different from file to file. 55 56So, the full effect of the command is to create a new 57branch – named ‘<code>rel-1-0-patches</code>’ – in module 58‘<code>tc</code>’, rooted in the revision tree at the point tagged 59by ‘<code>rel-1-0</code>’. 60 61This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>]. 62