1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
"http://www.w3.org/TR/html4/loose.dtd">
4
* Copyright © 2007 Sun Microsystems, Inc. All rights reserved.
5
* Use is subject to license terms.
9
<title>Working with Branches in Subversion</title>
10
<link href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css"
11
rel="StyleSheet" type="text/css">
16
<h2>Working with Branches in Subversion</h2>
18
<p><small><a href="#seealso">See Also</a></small></p>
20
<p>The IDE's Subversion support enables you to:</p>
23
<li><a href="#checkout">checkout branches</a> from a remote repository.</li>
24
<li><a href="#create">create branches</a> in the repository you are working from.</li>
25
<li><a href="#switch">switch to a branch</a> in the repository you are working from.</li>
28
<p>For more information on working with branches, see the Subversion documentation at:</p>
31
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
32
<param name="content" value="http://svnbook.red-bean.com/">
33
<param name="text" value="<html><u>http://svnbook.red-bean.com/</u></html>">
34
<param name="textFontSize" value="medium">
35
<param name="textColor" value="blue">
38
<h3><a name="checkout"></a>Checking out branches</h3>
40
<p>If you need to edit files on a branch folder that already exists, you can checkout
41
the branch to copy the files to a local working directory. You must however create
42
a new local working directory within which to checkout the branch.</p>
45
<h4>To checkout a branch to your local working directory:</h4>
48
<li>Choose Versioning > Subversion > Checkout from the main menu. The
49
Subversion Checkout wizard opens.</li>
50
<li>In the first panel of the wizard, enter a URL that contains the connection
51
protocol and location to the repository. Depending on your protocol selection
52
and connection requirements, enter any required parameters, such as username,
53
password, proxy configuration, etc. Click Next.</li>
54
<li>In the Folders to Checkout panel of the wizard, specify the folder that
55
represents the branch you want to check out in the Repository Folder(s) field.
56
You can click the Browse button to choose from a list of all folders in the
57
repository. Specify the revision number if you want to work from a specific
61
<li>To checkout only the contents of the folder you are specifying
62
(i.e. and not the folder itself), select the Skip
63
"<<tt>selected_folder</tt>>" and checkout only
64
its content option.</li>
67
<li>Specify the local working directory into which you want to checkout the
68
selected branch folder. Alternately, you can click the Browse button to
69
navigate to the desired directory on your system.</li>
70
<li>Click Finish to check out the branch folder. The IDE initiates the checkout
71
action and the IDE's status bar indicates the progress of the files
72
downloading from the repository to your local working directory. You can
73
also view files being checked out from the Output window (Ctrl-4).</li>
76
<h3><a name="create"></a>Creating branches</h3>
78
<p>If you want to work on a separate version of your file system for stabilization
79
or experimentation purposes, you can do so by creating a branch. To create a
80
branch in Subversion, you are effectively copying a version-controlled project
81
or folder and adding it to a new location within the repository. The IDE's
82
Subversion support enables you to select a source from either your local working
83
copy, or browse to a location in the repository you are working from. You can
84
create branches in the IDE by choosing Subversion > Copy To from a versioned
85
file or folder's contextual menu.</p>
87
<h4>To create a branch:</h4>
90
<li>Select the versioned project or folder (e.g. in the Projects, Files, or
91
Favorites window) that you want to be the root of your branch and choose
92
Subversion > Copy To. The Subversion Copy dialog box opens.</li>
93
<li>Under Source, select Local Folder if you want to create a branch from
94
your local working copy, otherwise select Remote Folder to specify the
95
version maintained in the repository.
98
<li>You can specify a specific revision of the selected item by entering
99
a revision number in the Revision text box. Clicking the Search button
100
adjacent to the Revision text box allows you to view revisions maintained
101
in the repository.</li>
102
<li>Click the <strong>Skip selected Folder and copy only its Contents</strong>
103
option if you want to avoid including the selected folder when creating
107
<li>Under Destination, select the target location for the new branch copy. In
108
Repository Location, type in a path relative to the repository, otherwise
109
click the Browse button to open a new dialog that aids in browsing the
110
repository folders.</li>
111
<li>Enter a description for the new branch folder in the Copy Description text
112
area. If you want to switch to the branch after creating it, select the
113
Switch to Copy checkbox.</li>
114
<li>Click Copy. The IDE creates the branch by copying the folder contents to the
115
specified location in the repository.</p>
118
<h3><a name="switch"></a>Switching to a Branch</h3>
120
<p>If you want to switch your local working copy to point to a branch or other
121
location in the repository, you can do so using the Subversion Switch to
124
<h4>To switch to a branch or other location in the repository:</h4>
127
<li>Select a versioned file or folder (e.g. from the Projects, Files, or Favorites
128
window) and choose either Subversion > Switch to Copy from the right-click
129
menu or Versioning > Switch to from the IDE's main menu. The Subversion Switch
130
dialog box opens.</li>
131
<li>For Repository Folder, enter the branch folder you want to switch to, or click
132
Browse to view a list of all locations in the repository.
135
<li>If you need to specify a previous revision, enter the revision number
136
for the selected location. Leave blank if you require the most recent
137
revision. To display a log of all revisions for the selected location,
138
you can click the Search button.</li>
141
<li>Click Switch. The IDE updates your working copy to reflect the content maintained
142
by the newly selected branch location in the repository. Note that any differences
143
arising between your local working copy and the location that you are switching to
144
will be overwritten by the new location.</li>
149
<a name="seealso">See Also</a></dt>
150
<dd> <a href="svn_checkout.html">Checking Out Files from a Subversion Repository</a></dd>
154
<small><a href="../credits.html">Legal Notices</a></small>