~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
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
12
via SFTP, a secure protocol built-in to most SSH servers.
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
  ===========         ======================================================
4734.1.1 by John Szakmeister
Prevent several partial URLs from being highlighted by Sphinx.
19
  \file://            Access using the standard filesystem (default)
20
  \sftp://            Access using SFTP (most SSH servers provide SFTP).
21
  \bzr://             Fast access using the Bazaar smart server.
22
  \ftp://             Access using passive FTP.
23
  \http://            Read-only access to branches exported by a web server.
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
24
  ===========         ======================================================
25
26
As indicated above, branches are identified using URLs with the
27
prefix indicating the transfer technology. If no prefix is given,
28
normal filenames are assumed. For a complete list of supported
29
protocols, see the ``urlspec`` online help topic or the
30
`URL Identifiers <../user-reference/bzr_man.html#url-identifiers>`_
31
section of the Bazaar User Reference.
32
5077.3.3 by Martin Pool
Add doc about root and homedir-relative URLs
33
URLs are normally resolved relative to the root directory of the server,
34
so ``ftp://example.com/repo/foo`` means the ``/repo/foo`` directory of
35
that host.  (We say 'normally' because some server software like Apache
36
can be configured to remap URLs arbitrarily, in which case you'll need to
37
look at the server configuration to find out which URL corresponds to
38
which directory.)
39
40
To address a path relative to your home directory on the server, use a
41
tilde like so: ``sftp://example.com/~/public_html`` should map to
42
``public_html`` within your home directory.
43
3234.1.1 by Neil Martinsen-Burrell
minor doc changes
44
A reminder about shared repositories
45
------------------------------------
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
46
47
Before getting a copy of a branch, have a quick think about
48
where to put it on your filesystem. For maximum storage
49
efficiency down the track, it is recommended that branches
3234.1.1 by Neil Martinsen-Burrell
minor doc changes
50
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
51
as a shared repository. (See `Feature branches
52
<organizing_your_workspace.html#feature-branches>`_ in
53
`Organizing your workspace <organizing_your_workspace.html>`_
54
for a commonly used layout.) For example::
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
55
56
  bzr init-repo my-repo
57
  cd my-repo
58
59
You are now ready to grab a branch from someone else and
60
hack away.
61
62
The branch command
63
------------------
64
3427.6.1 by James Westby
Small tweaks to the "branch" command documentation in the user guide.
65
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
66
The syntax is::
67
68
  bzr branch URL [directory]
69
70
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.
71
the URL. Here are some examples showing a drive qualified path (M:/) and an
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
72
sftp URL respectively::
73
3427.6.2 by James Westby
Refer to a "drive qualified path" as suggested by Aaron.
74
  bzr branch M:/cool-trunk
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
75
  bzr branch sftp://bill@mary-laptop/cool-repo/cool-trunk
76
77
This example shows explicitly giving the directory name to use for the
78
new branch::
79
80
  bzr branch /home/mary/cool-repo/cool-trunk cool
81
82
Time and space considerations
83
-----------------------------
84
85
Depending on the size of the branch being transferred and the
86
speed and latency of the network between your computer and the
87
source branch, this initial transfer might take some time.
2977.1.11 by Ian Clatworthy
make fixes suggested by proof-readers
88
Subsequent updates should be much faster as only the
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
89
changes are transferred then.
90
91
Keep in mind that Bazaar is transferring the
92
complete history of the branch, not just the latest snapshot.
93
As a consequence, you can be off the network (or disconnected
94
from the network share) after ``branch`` completes but you'll
95
still be able to ``log`` and ``diff`` the history of the
96
branch as much as you want. Furthermore, these operations
97
are quick as the history is stored locally.
98
99
Note that Bazaar uses smart compression technology to
100
minimize the amount of disk space required to store version
101
history. In many cases, the complete history of a project
102
will take up less disk space than the working copy of
103
the latest version.
104
105
As explained in later chapters, Bazaar also has support for
4853.1.1 by Patrick Regan
Removed trailing whitespace from files in doc directory
106
`lightweight checkouts <using_checkouts.html#getting-a-lightweight-checkout>`_
3779.2.1 by mernst at mit
Improved documentation of stacked and lightweight branches
107
of a branch, i.e. working trees with
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
108
no local storage of history. Of course, disconnected usage
109
is not available then but that's a tradeoff you can decide
110
to make if local disk space is really tight for you. Support for
111
limited lookback into history - *history horizons* - is
112
currently under development as well.
113
114
Viewing branch information
115
--------------------------
116
117
If you wish to see information about a branch including where it came from,
118
use the ``info`` command. For example::
119
120
  bzr info cool
121
122
If no branch is given, information on the current branch is displayed.