~thumper/bzr/alias-command

« back to all changes in this revision

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

  • Committer: Tim Penhey
  • Date: 2008-04-20 08:48:04 UTC
  • mfrom: (2900.1.474 +trunk)
  • Revision ID: tim@penhey.net-20080420084804-fw6m8ezw4n7pnmo1
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Recording changes
 
2
=================
 
3
 
 
4
bzr commit
 
5
----------
 
6
 
 
7
When the working tree state is satisfactory, it can be **committed** to
 
8
the branch, creating a new revision holding a snapshot of that state.  
 
9
 
 
10
The **commit** command takes a message describing the changes in the
 
11
revision.  It also records your userid, the current time and timezone, and
 
12
the inventory and contents of the tree.  The commit message is specified
 
13
by the ``-m`` or ``--message`` option. You can enter a multi-line commit
 
14
message; in most shells you can enter this just by leaving the quotes open
 
15
at the end of the line.
 
16
 
 
17
::
 
18
 
 
19
    % bzr commit -m "added my first file"
 
20
 
 
21
You can also use the ``-F`` option to take the message from a file.  Some
 
22
people like to make notes for a commit message while they work, then
 
23
review the diff to make sure they did what they said they did.  (This file
 
24
can also be useful when you pick up your work after a break.)
 
25
 
 
26
Message from an editor
 
27
----------------------
 
28
 
 
29
If you use neither the ``-m`` nor the ``-F`` option then bzr will open an
 
30
editor for you to enter a message.  The editor to run is controlled by
 
31
your ``$VISUAL`` or ``$EDITOR`` environment variable, which can be overridden
 
32
by the ``editor`` setting in ``~/.bazaar/bazaar.conf``; ``$BZR_EDITOR`` will
 
33
override either of the above mentioned editor options.  If you quit the
 
34
editor without making any changes, the commit will be cancelled.
 
35
 
 
36
The file that is opened in the editor contains a horizontal line. The part
 
37
of the file below this line is included for information only, and will not
 
38
form part of the commit message. Below the separator is shown the list of
 
39
files that are changed in the commit. You should write your message above
 
40
the line, and then save the file and exit.
 
41
 
 
42
If you would like to see the diff that will be committed as you edit the
 
43
message you can use the ``--show-diff`` option to ``commit``. This will include
 
44
the diff in the editor when it is opened, below the separator and the
 
45
information about the files that will be committed. This means that you can
 
46
read it as you write the message, but the diff itself wont be seen in the
 
47
commit message when you have finished. If you would like parts to be
 
48
included in the message you can copy and paste them above the separator.
 
49
 
 
50
Selective commit
 
51
----------------
 
52
 
 
53
If you give file or directory names on the commit command line then only
 
54
the changes to those files will be committed.  For example::
 
55
 
 
56
    % bzr commit -m "documentation fix" commit.py
 
57
 
 
58
By default bzr always commits all changes to the tree, even if run from a
 
59
subdirectory.  To commit from only the current directory down, use::
 
60
 
 
61
    % bzr commit .
 
62