~bzr-pqm/bzr/bzr.dev

2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
1
Branching a project
2
===================
3
4
Branch URLs
5
-----------
6
7
Before someone else can get a copy of your work, you need to
8
agree on a transfer technology.
9
You may decide to make the top level directory of your branch
10
a network share, an approach familiar to Windows users.
5278.1.5 by Martin Pool
Correct more sloppy use of the term 'Linux'
11
Unix users might prefer access to be
5761.1.1 by Martin Pool
Recommend SSH rather than SFTP in user documentation examples
12
via SSH, a secure protocol built-in to most SSH servers.
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
13
Bazaar is *very* flexible in this regard with support for
14
lots of protocols some of which are given below.
15
16
  ===========         ======================================================
17
  Prefix              Description
18
  ===========         ======================================================
5761.1.1 by Martin Pool
Recommend SSH rather than SFTP in user documentation examples
19
  \file://            Access using the standard filesystem (default).
20
  \bzr+ssh:/          Access over SSH (best remote option).
4734.1.1 by John Szakmeister
Prevent several partial URLs from being highlighted by Sphinx.
21
  \sftp://            Access using SFTP (most SSH servers provide SFTP).
22
  \bzr://             Fast access using the Bazaar smart server.
23
  \ftp://             Access using passive FTP.
5439.3.1 by John C Barstow
Make it clearer that we support HTTPS
24
  \http://            Access to branches exported by a web server.
25
  \https://           Encrypted access to branches exported by a web server.
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
26
  ===========         ======================================================
27
28
As indicated above, branches are identified using URLs with the
29
prefix indicating the transfer technology. If no prefix is given,
30
normal filenames are assumed. For a complete list of supported
31
protocols, see the ``urlspec`` online help topic or the
4634.164.2 by Alexander Belchenko
change links to user-reference/bzr_man.html to user-reference/index.html everywhere in the User Guide.
32
`URL Identifiers <../user-reference/index.html#url-identifiers>`_
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
33
section of the Bazaar User Reference.
34
5077.3.3 by Martin Pool
Add doc about root and homedir-relative URLs
35
URLs are normally resolved relative to the root directory of the server,
36
so ``ftp://example.com/repo/foo`` means the ``/repo/foo`` directory of
37
that host.  (We say 'normally' because some server software like Apache
38
can be configured to remap URLs arbitrarily, in which case you'll need to
39
look at the server configuration to find out which URL corresponds to
40
which directory.)
41
42
To address a path relative to your home directory on the server, use a
5761.1.1 by Martin Pool
Recommend SSH rather than SFTP in user documentation examples
43
tilde like so: ``bzr+ssh://example.com/~/public_html`` should map to
5077.3.3 by Martin Pool
Add doc about root and homedir-relative URLs
44
``public_html`` within your home directory.
45
5439.3.2 by John C Barstow
Fix wrapping of note directive so inline ref directive is properly parsed.
46
.. note:: Access over HTTP or HTTPS is read-only by default.
5538.2.1 by Zearin
Fixed capitalization of XML and HTTP. Fixed by hand and only where appropriate (e.g., left http://some/url lowercase, but capitalized "When making an HTTP request…").
47
   See `Pushing over the HTTP smart server
5439.3.4 by John C Barstow
Really fix the docutils link
48
   <http_smart_server.html#pushing-over-the-http-smart-server>`_ for
5439.3.3 by John C Barstow
Convert link to plain docutils
49
   details on configuring read-write access.
5439.3.1 by John C Barstow
Make it clearer that we support HTTPS
50
3234.1.1 by Neil Martinsen-Burrell
minor doc changes
51
A reminder about shared repositories
52
------------------------------------
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
53
54
Before getting a copy of a branch, have a quick think about
55
where to put it on your filesystem. For maximum storage
56
efficiency down the track, it is recommended that branches
3234.1.1 by Neil Martinsen-Burrell
minor doc changes
57
be created somewhere under a directory that has been set up
4634.39.41 by Ian Clatworthy
Fix the broken links in the User Guide
58
as a shared repository. (See `Feature branches
59
<organizing_your_workspace.html#feature-branches>`_ in
60
`Organizing your workspace <organizing_your_workspace.html>`_
61
for a commonly used layout.) For example::
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
62
63
  bzr init-repo my-repo
64
  cd my-repo
65
66
You are now ready to grab a branch from someone else and
67
hack away.
68
69
The branch command
70
------------------
71
3427.6.1 by James Westby
Small tweaks to the "branch" command documentation in the user guide.
72
To get a branch based on an existing branch, use the ``branch`` command.
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
73
The syntax is::
74
75
  bzr branch URL [directory]
76
77
If a directory is not given, one is created based on the last part of
3427.6.2 by James Westby
Refer to a "drive qualified path" as suggested by Aaron.
78
the URL. Here are some examples showing a drive qualified path (M:/) and an
5538.2.2 by Zearin
Continued capitalization fixes ([S]FTP, SSH).
79
SFTP URL respectively::
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
80
3427.6.2 by James Westby
Refer to a "drive qualified path" as suggested by Aaron.
81
  bzr branch M:/cool-trunk
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
82
  bzr branch sftp://bill@mary-laptop/cool-repo/cool-trunk
83
84
This example shows explicitly giving the directory name to use for the
85
new branch::
86
87
  bzr branch /home/mary/cool-repo/cool-trunk cool
88
89
Time and space considerations
90
-----------------------------
91
92
Depending on the size of the branch being transferred and the
93
speed and latency of the network between your computer and the
94
source branch, this initial transfer might take some time.
2977.1.11 by Ian Clatworthy
make fixes suggested by proof-readers
95
Subsequent updates should be much faster as only the
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
96
changes are transferred then.
97
98
Keep in mind that Bazaar is transferring the
99
complete history of the branch, not just the latest snapshot.
100
As a consequence, you can be off the network (or disconnected
101
from the network share) after ``branch`` completes but you'll
102
still be able to ``log`` and ``diff`` the history of the
103
branch as much as you want. Furthermore, these operations
104
are quick as the history is stored locally.
105
106
Note that Bazaar uses smart compression technology to
107
minimize the amount of disk space required to store version
108
history. In many cases, the complete history of a project
109
will take up less disk space than the working copy of
110
the latest version.
111
112
As explained in later chapters, Bazaar also has support for
4853.1.1 by Patrick Regan
Removed trailing whitespace from files in doc directory
113
`lightweight checkouts <using_checkouts.html#getting-a-lightweight-checkout>`_
3779.2.1 by mernst at mit
Improved documentation of stacked and lightweight branches
114
of a branch, i.e. working trees with
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
115
no local storage of history. Of course, disconnected usage
116
is not available then but that's a tradeoff you can decide
117
to make if local disk space is really tight for you. Support for
118
limited lookback into history - *history horizons* - is
119
currently under development as well.
120
121
Viewing branch information
122
--------------------------
123
124
If you wish to see information about a branch including where it came from,
125
use the ``info`` command. For example::
126
127
  bzr info cool
128
129
If no branch is given, information on the current branch is displayed.