Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > 27647990744ebd9cfe32398f37f67e20 > files > 3008

bzr-2.6.0-11.1.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Branching a project &mdash; Bazaar 2.6.0 documentation</title>
    
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.6.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../_static/bzr.ico"/>
    <link rel="top" title="Bazaar 2.6.0 documentation" href="../index.html" />
    <link rel="up" title="Bazaar User Guide" href="index.html" />
    <link rel="next" title="Merging changes" href="merging_changes.html" />
    <link rel="prev" title="Working with another" href="partner_intro.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="merging_changes.html" title="Merging changes"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="partner_intro.html" title="Working with another"
             accesskey="P">previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="../_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li><a href="../index.html">Table of Contents (2.6.0)</a> &raquo;</li>

          <li><a href="index.html" accesskey="U">Bazaar User Guide</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="branching-a-project">
<h1>Branching a project<a class="headerlink" href="#branching-a-project" title="Permalink to this headline">¶</a></h1>
<div class="section" id="branch-urls">
<h2>Branch URLs<a class="headerlink" href="#branch-urls" title="Permalink to this headline">¶</a></h2>
<p>Before someone else can get a copy of your work, you need to
agree on a transfer technology.
You may decide to make the top level directory of your branch
a network share, an approach familiar to Windows users.
Unix users might prefer access to be
via SSH, a secure protocol built-in to most SSH servers.
Bazaar is <em>very</em> flexible in this regard with support for
lots of protocols some of which are given below.</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="17%" />
<col width="83%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Prefix</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>file://</td>
<td>Access using the standard filesystem (default).</td>
</tr>
<tr class="row-odd"><td>bzr+ssh:/</td>
<td>Access over SSH (best remote option).</td>
</tr>
<tr class="row-even"><td>sftp://</td>
<td>Access using SFTP (most SSH servers provide SFTP).</td>
</tr>
<tr class="row-odd"><td>bzr://</td>
<td>Fast access using the Bazaar smart server.</td>
</tr>
<tr class="row-even"><td>ftp://</td>
<td>Access using passive FTP.</td>
</tr>
<tr class="row-odd"><td>http://</td>
<td>Access to branches exported by a web server.</td>
</tr>
<tr class="row-even"><td>https://</td>
<td>Encrypted access to branches exported by a web server.</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>As indicated above, branches are identified using URLs with the
prefix indicating the transfer technology. If no prefix is given,
normal filenames are assumed. For a complete list of supported
protocols, see the <tt class="docutils literal"><span class="pre">urlspec</span></tt> online help topic or the
<a class="reference external" href="../user-reference/index.html#url-identifiers">URL Identifiers</a>
section of the Bazaar User Reference.</p>
<p>URLs are normally resolved relative to the root directory of the server,
so <tt class="docutils literal"><span class="pre">ftp://example.com/repo/foo</span></tt> means the <tt class="docutils literal"><span class="pre">/repo/foo</span></tt> directory of
that host.  (We say &#8216;normally&#8217; because some server software like Apache
can be configured to remap URLs arbitrarily, in which case you&#8217;ll need to
look at the server configuration to find out which URL corresponds to
which directory.)</p>
<p>To address a path relative to your home directory on the server, use a
tilde like so: <tt class="docutils literal"><span class="pre">bzr+ssh://example.com/~/public_html</span></tt> should map to
<tt class="docutils literal"><span class="pre">public_html</span></tt> within your home directory.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Access over HTTP or HTTPS is read-only by default.
See <a class="reference external" href="http_smart_server.html#pushing-over-the-http-smart-server">Pushing over the HTTP smart server</a> for
details on configuring read-write access.</p>
</div>
</div>
<div class="section" id="a-reminder-about-shared-repositories">
<h2>A reminder about shared repositories<a class="headerlink" href="#a-reminder-about-shared-repositories" title="Permalink to this headline">¶</a></h2>
<p>Before getting a copy of a branch, have a quick think about
where to put it on your filesystem. For maximum storage
efficiency down the track, it is recommended that branches
be created somewhere under a directory that has been set up
as a shared repository. (See <a class="reference external" href="organizing_your_workspace.html#feature-branches">Feature branches</a> in
<a class="reference external" href="organizing_your_workspace.html">Organizing your workspace</a>
for a commonly used layout.) For example:</p>
<div class="highlight-python"><div class="highlight"><pre>bzr init-repo my-repo
cd my-repo
</pre></div>
</div>
<p>You are now ready to grab a branch from someone else and
hack away.</p>
</div>
<div class="section" id="the-branch-command">
<h2>The branch command<a class="headerlink" href="#the-branch-command" title="Permalink to this headline">¶</a></h2>
<p>To get a branch based on an existing branch, use the <tt class="docutils literal"><span class="pre">branch</span></tt> command.
The syntax is:</p>
<div class="highlight-python"><div class="highlight"><pre>bzr branch URL [directory]
</pre></div>
</div>
<p>If a directory is not given, one is created based on the last part of
the URL. Here are some examples showing a drive qualified path (M:/) and an
SFTP URL respectively:</p>
<div class="highlight-python"><div class="highlight"><pre>bzr branch M:/cool-trunk
bzr branch sftp://bill@mary-laptop/cool-repo/cool-trunk
</pre></div>
</div>
<p>This example shows explicitly giving the directory name to use for the
new branch:</p>
<div class="highlight-python"><div class="highlight"><pre>bzr branch /home/mary/cool-repo/cool-trunk cool
</pre></div>
</div>
</div>
<div class="section" id="time-and-space-considerations">
<h2>Time and space considerations<a class="headerlink" href="#time-and-space-considerations" title="Permalink to this headline">¶</a></h2>
<p>Depending on the size of the branch being transferred and the
speed and latency of the network between your computer and the
source branch, this initial transfer might take some time.
Subsequent updates should be much faster as only the
changes are transferred then.</p>
<p>Keep in mind that Bazaar is transferring the
complete history of the branch, not just the latest snapshot.
As a consequence, you can be off the network (or disconnected
from the network share) after <tt class="docutils literal"><span class="pre">branch</span></tt> completes but you&#8217;ll
still be able to <tt class="docutils literal"><span class="pre">log</span></tt> and <tt class="docutils literal"><span class="pre">diff</span></tt> the history of the
branch as much as you want. Furthermore, these operations
are quick as the history is stored locally.</p>
<p>Note that Bazaar uses smart compression technology to
minimize the amount of disk space required to store version
history. In many cases, the complete history of a project
will take up less disk space than the working copy of
the latest version.</p>
<p>As explained in later chapters, Bazaar also has support for
<a class="reference external" href="using_checkouts.html#getting-a-lightweight-checkout">lightweight checkouts</a>
of a branch, i.e. working trees with
no local storage of history. Of course, disconnected usage
is not available then but that&#8217;s a tradeoff you can decide
to make if local disk space is really tight for you. Support for
limited lookback into history - <em>history horizons</em> - is
currently under development as well.</p>
</div>
<div class="section" id="viewing-branch-information">
<h2>Viewing branch information<a class="headerlink" href="#viewing-branch-information" title="Permalink to this headline">¶</a></h2>
<p>If you wish to see information about a branch including where it came from,
use the <tt class="docutils literal"><span class="pre">info</span></tt> command. For example:</p>
<div class="highlight-python"><div class="highlight"><pre>bzr info cool
</pre></div>
</div>
<p>If no branch is given, information on the current branch is displayed.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Branching a project</a><ul>
<li><a class="reference internal" href="#branch-urls">Branch URLs</a></li>
<li><a class="reference internal" href="#a-reminder-about-shared-repositories">A reminder about shared repositories</a></li>
<li><a class="reference internal" href="#the-branch-command">The branch command</a></li>
<li><a class="reference internal" href="#time-and-space-considerations">Time and space considerations</a></li>
<li><a class="reference internal" href="#viewing-branch-information">Viewing branch information</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="partner_intro.html"
                        title="previous chapter">Working with another</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="merging_changes.html"
                        title="next chapter">Merging changes</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/user-guide/branching_a_project.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="merging_changes.html" title="Merging changes"
             >next</a></li>
        <li class="right" >
          <a href="partner_intro.html" title="Working with another"
             >previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="../_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li><a href="../index.html">Table of Contents (2.6.0)</a> &raquo;</li>

          <li><a href="index.html" >Bazaar User Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2011 Canonical Ltd.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>