~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-10-11 00:23:23 UTC
  • mfrom: (2070 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20061011002323-82ba88c293d7caff
[merge] bzr.dev 2070

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Controlling file registration
2
 
=============================
3
 
 
4
 
What does Bazaar track?
5
 
-----------------------
6
 
 
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:
10
 
 
11
 
 * files
12
 
 * directories
13
 
 * symbolic links.
14
 
 
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.
18
 
 
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.
23
 
 
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.
26
 
 
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.
30
 
 
31
 
Selective registration
32
 
----------------------
33
 
 
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::
37
 
 
38
 
  bzr add fileX dirY/
39
 
 
40
 
Adding a directory implicitly adds all interesting things
41
 
underneath it.
42
 
 
43
 
Ignoring files
44
 
--------------
45
 
 
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.
51
 
 
52
 
This file contains a list of file wildcards (or "globs"), one per line.
53
 
Typical contents are like this::
54
 
 
55
 
    *.o
56
 
    *~
57
 
    *.tmp
58
 
    *.py[co]
59
 
 
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/``::
65
 
 
66
 
    ./config.h
67
 
    doc/*.html
68
 
 
69
 
To get a list of which files are ignored and what pattern they matched,
70
 
use ``bzr ignored``::
71
 
 
72
 
    % bzr ignored
73
 
    config.h                 ./config.h
74
 
    configure.in~            *~
75
 
 
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
79
 
ignored.
80
 
 
81
 
The ``.bzrignore`` file should normally be versioned, so that new copies
82
 
of the branch see the same patterns::
83
 
 
84
 
    % bzr add .bzrignore
85
 
    % bzr commit -m "Add ignore patterns"
86
 
 
87
 
Global ignores
88
 
--------------
89
 
 
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.
95
 
 
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.