/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
1
Starting a project
2
==================
3
4
Putting an existing project under version control
5
-------------------------------------------------
6
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::
9
10
  cd my-stuff
11
  bzr init
12
  bzr add
2977.1.11 by Ian Clatworthy
make fixes suggested by proof-readers
13
  bzr commit -m "Initial import"
2977.1.3 by Ian Clatworthy
1st cut at the 'Personal version control' chapter
14
15
``bzr init`` creates a ``.bzr`` directory in the top level directory
16
(``my-stuff`` in the example above). Note that:
17
18
 * Bazaar has everything it needs in that directory - you do
19
   **not** need to setup a database, web server or special service
20
   to use it
21
22
 * Bazaar is polite enough to only create one ``.bzr`` in the
23
   directory given, not one in every subdirectory thereof.
24
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.
29
30
More information on ``init``, ``add`` and ``commit`` will be provided
31
later. For now, the important thing to remember is the recipe above.
32
33
Starting a new project
34
----------------------
35
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::
41
42
  bzr init-repo my.repo
43
  cd my.repo
44
  bzr init my.main
45
  cd my.main
46
  hack, hack, hack
47
  bzr add
48
  bzr commit -m "Initial import"
49
50
Some users prefer a name like *trunk* or *dev* to *main*. Choose
51
whichever name makes the most sense to you.
52
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.
55