/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/en/user-guide/publishing_a_branch.txt

Merge with serialize-transform

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Publishing a branch
 
2
===================
 
3
 
 
4
Setting up a central repository
 
5
-------------------------------
 
6
 
 
7
While the centralized workflow can be used by socially nominating
 
8
any branch on any computer as the central one, in practice most
 
9
teams have a dedicated server for hosting central branches.
 
10
 
 
11
Just as it's best practice to use a shared repository locally,
 
12
it's advisable to put central branches in a shared repository.
 
13
Note that central shared branches typically only want to
 
14
store history, not working copies of files, so their enclosing
 
15
repository is usually creating using the ``no-trees`` option, e.g.::
 
16
 
 
17
  bzr init-repo --no-trees sftp://centralhost/srv/bzr/X-repo/
 
18
 
 
19
You can think of this step as similar to setting up a new cvsroot or
 
20
Subversion repository. However, Bazaar gives you more flexibility
 
21
in how branches may be organised in your repository. See
 
22
`Choosing a shared repository layout`_ in the appendices for
 
23
guidelines and examples.
 
24
 
 
25
 
 
26
Starting a central branch
 
27
-------------------------
 
28
 
 
29
There are two ways of populating a central branch with some initial
 
30
content:
 
31
 
 
32
 1. Making a local branch and pushing it to a central location
 
33
 2. Making an empty central branch then committing content to it.
 
34
 
 
35
Here is an example of the first way::
 
36
 
 
37
  bzr init-repo X-repo
 
38
  bzr init X-repo/X-trunk
 
39
  cd X-repo/X-trunk
 
40
  cp -ar ~/X .     (copy files in using OS-specific tools)
 
41
  bzr add
 
42
  bzr commit -m "Initial import"
 
43
  (local branch has content - publish it centrally now)
 
44
  bzr push sftp://centralhost/srv/bzr/X-repo/X-trunk
 
45
 
 
46
Here is an example of the second way::
 
47
 
 
48
  bzr init-repo X-repo
 
49
  cd X-repo
 
50
  bzr init sftp://centralhost/srv/bzr/X-repo/X-trunk
 
51
  bzr checkout sftp://centralhost/srv/bzr/X-repo/X-trunk
 
52
  cd X-trunk
 
53
  cp -ar ~/X .     (copy files in using OS-specific tools)
 
54
  bzr add
 
55
  bzr commit -m "Initial import"
 
56
 
 
57
Note that committing inside a working tree created using
 
58
the ``checkout`` command implicitly commits the content to
 
59
the central location as well as locally. Had we used the
 
60
``branch`` command instead of ``checkout`` above, the
 
61
content would have only been committed locally.
 
62
 
 
63
Working trees that are tightly bound to a central location
 
64
like this are called *checkouts*. The rest of this chapter
 
65
explains their numerous features in more detail.