4
Setting up a central repository
5
-------------------------------
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.
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.::
17
bzr init-repo --no-trees sftp://centralhost/srv/bzr/X-repo/
19
You can think of this step as similar to setting up a new cvsroot or
20
Subversion repository.
22
Starting a central branch
23
-------------------------
25
There are two ways of populating a central branch with some initial
28
1. Making a local branch and pushing it to a central location
29
2. Making an empty central branch then committing content to it.
31
Here is an example of the first way::
34
bzr init X-repo/X-trunk
36
cp -ar ~/X . (copy files in using OS-specific tools)
38
bzr commit -m "Initial import"
39
(local branch has content - publish it centrally now)
40
bzr push sftp://centralhost/srv/bzr/X-repo/X-trunk
42
Here is an example of the second way::
46
bzr init sftp://centralhost/srv/bzr/X-repo/X-trunk
47
bzr checkout sftp://centralhost/srv/bzr/X-repo/X-trunk
49
cp -ar ~/X . (copy files in using OS-specific tools)
51
bzr commit -m "Initial import"
53
Note that committing inside a working tree created using
54
the ``checkout`` command implicitly commits the content to
55
the central location as well as locally. Had we used the
56
``branch`` command instead of ``checkout`` above, the
57
content would have only been committed locally.
59
Working trees that are tightly bound to a central location
60
like this are called *checkouts*. The rest of this chapter
61
explains their numerous features in more detail.