1
Controlling file registration
2
=============================
4
What does Bazaar track?
5
-----------------------
7
As explained earlier, ``bzr add`` finds and registers all the things in
8
and under the current directory that Bazaar thinks ought to be
9
version controlled. These things may be:
15
Bazaar has default rules for deciding which files are
16
interesting and which ones are not. You can tune those rules as
17
explained in `Ignoring files`_ below.
19
Unlike many other VCS tools, Bazaar tracks directories as first class
20
items. As a consequence, empty directories are correctly supported -
21
you don't need to create a dummy file inside a directory just to
22
ensure it gets tracked and included in project exports.
24
For symbolic links, the value of the symbolic link is tracked,
25
not the content of the thing the symbolic link is pointing to.
27
Note: Support for tracking projects-within-projects ("nested trees")
28
is currently under development. Please contact the Bazaar developers
29
if you are interested in helping develop or test this functionality.
31
Selective registration
32
----------------------
34
In some cases, you may want or need to explicitly nominate the things
35
to register rather than leave it up to Bazaar to find things. To do this,
36
simply provide paths as arguments to the ``add`` command like this::
40
Adding a directory implicitly adds all interesting things
46
Many source trees contain some files that do not need to be versioned,
47
such as editor backups, object or bytecode files, and built programs. You
48
can simply not add them, but then they'll always crop up as unknown files.
49
You can also tell Bazaar to ignore these files by adding them to a file
50
called ``.bzrignore`` at the top of the tree.
52
This file contains a list of file wildcards (or "globs"), one per line.
53
Typical contents are like this::
60
If a glob contains a slash, it is matched against the whole path from the
61
top of the tree; otherwise it is matched against only the filename. So
62
the previous example ignores files with extension ``.o`` in all
63
subdirectories, but this example ignores only ``config.h`` at the top level
64
and HTML files in ``doc/``::
69
To get a list of which files are ignored and what pattern they matched,
76
It is OK to have either an ignore pattern match a versioned file, or to
77
add an ignored file. Ignore patterns have no effect on versioned files;
78
they only determine whether unversioned files are reported as unknown or
81
The ``.bzrignore`` file should normally be versioned, so that new copies
82
of the branch see the same patterns::
85
% bzr commit -m "Add ignore patterns"
90
There are some ignored files which are not project specific, but more user
91
specific. Things like editor temporary files, or personal temporary files.
92
Rather than add these ignores to every project, bzr supports a global
93
ignore file in ``~/.bazaar/ignore`` [#]_. It has the same syntax as the
94
per-project ignore file.
96
.. [#] On Windows, the users configuration files can be found in the
97
application data directory. So instead of ``~/.bazaar/branch.conf``
98
the configuration file can be found as:
99
``C:\Documents and Settings\<username>\Application Data\Bazaar\2.0\branch.conf``.
100
The same is true for ``locations.conf``, ``ignore``, and the
101
``plugins`` directory.