4
Putting an existing project under version control
5
-------------------------------------------------
7
If you already have a tree of source code (or directory of documents) you
8
wish to put under version control, here are the commands to use::
13
bzr commit -m "Initial import"
15
``bzr init`` creates a ``.bzr`` directory in the top level directory
16
(``my-stuff`` in the example above). Note that:
18
* Bazaar has everything it needs in that directory - you do
19
**not** need to setup a database, web server or special service
22
* Bazaar is polite enough to only create one ``.bzr`` in the
23
directory given, not one in every subdirectory thereof.
25
``bzr add`` then finds all the files and directories it thinks
26
ought to be version controlled and registers them internally.
27
``bzr commit`` then records a snapshot of the content of these
28
and records that information, together with a commit message.
30
More information on ``init``, ``add`` and ``commit`` will be provided
31
later. For now, the important thing to remember is the recipe above.
33
Starting a new project
34
----------------------
36
If you are starting a project from scratch, you can also use the recipe
37
above, after creating an empty directory first of course. For efficiency
38
reasons that will be explored more in later chapters though, it is a good
39
idea to create a repository for the project at the top level and to nest
40
a *main* branch within it like this::
48
bzr commit -m "Initial import"
50
Some users prefer a name like *trunk* or *dev* to *main*. Choose
51
whichever name makes the most sense to you.
53
Note that the ``init-repo`` and ``init`` commands both take a path as an
54
argument and will create that path if it doesn't already exist.