~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.
11
Linux and OS X users might prefer access to be
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
  ===========         ======================================================
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.
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
3234.1.1 by Neil Martinsen-Burrell
minor doc changes
33
A reminder about shared repositories
34
------------------------------------
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
35
36
Before getting a copy of a branch, have a quick think about
37
where to put it on your filesystem. For maximum storage
38
efficiency down the track, it is recommended that branches
3234.1.1 by Neil Martinsen-Burrell
minor doc changes
39
be created somewhere under a directory that has been set up
4054.4.1 by Ian Clatworthy
added Organizing your workspace to the User Guide
40
as a shared repository. (See `Feature branches`_ in
41
n `Organizing your workspace`_ for a commonly used layout.)
3779.2.1 by mernst at mit
Improved documentation of stacked and lightweight branches
42
For example::
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
43
44
  bzr init-repo my-repo
45
  cd my-repo
46
47
You are now ready to grab a branch from someone else and
48
hack away.
49
50
The branch command
51
------------------
52
3427.6.1 by James Westby
Small tweaks to the "branch" command documentation in the user guide.
53
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
54
The syntax is::
55
56
  bzr branch URL [directory]
57
58
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.
59
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
60
sftp URL respectively::
61
3427.6.2 by James Westby
Refer to a "drive qualified path" as suggested by Aaron.
62
  bzr branch M:/cool-trunk
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
63
  bzr branch sftp://bill@mary-laptop/cool-repo/cool-trunk
64
65
This example shows explicitly giving the directory name to use for the
66
new branch::
67
68
  bzr branch /home/mary/cool-repo/cool-trunk cool
69
70
Time and space considerations
71
-----------------------------
72
73
Depending on the size of the branch being transferred and the
74
speed and latency of the network between your computer and the
75
source branch, this initial transfer might take some time.
2977.1.11 by Ian Clatworthy
make fixes suggested by proof-readers
76
Subsequent updates should be much faster as only the
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
77
changes are transferred then.
78
79
Keep in mind that Bazaar is transferring the
80
complete history of the branch, not just the latest snapshot.
81
As a consequence, you can be off the network (or disconnected
82
from the network share) after ``branch`` completes but you'll
83
still be able to ``log`` and ``diff`` the history of the
84
branch as much as you want. Furthermore, these operations
85
are quick as the history is stored locally.
86
87
Note that Bazaar uses smart compression technology to
88
minimize the amount of disk space required to store version
89
history. In many cases, the complete history of a project
90
will take up less disk space than the working copy of
91
the latest version.
92
93
As explained in later chapters, Bazaar also has support for
3779.2.1 by mernst at mit
Improved documentation of stacked and lightweight branches
94
`lightweight checkouts <#getting-a-lightweight-checkout>`_ 
95
of a branch, i.e. working trees with
2977.1.5 by Ian Clatworthy
added chapter on Sharing with a peer
96
no local storage of history. Of course, disconnected usage
97
is not available then but that's a tradeoff you can decide
98
to make if local disk space is really tight for you. Support for
99
limited lookback into history - *history horizons* - is
100
currently under development as well.
101
102
Viewing branch information
103
--------------------------
104
105
If you wish to see information about a branch including where it came from,
106
use the ``info`` command. For example::
107
108
  bzr info cool
109
110
If no branch is given, information on the current branch is displayed.