4
Sometimes you will want to temporarily remove changes from your working
5
tree and restore them later, For instance to commit a small bug-fix you
6
found while working on something. Bazaar allows you to put changes on
7
a ``shelf`` to achieve this. When you want to restore the changes later
8
you can use ``unshelve`` to apply them to your working tree again.
10
For example, consider a working tree with one or more changes made ... ::
13
=== modified file 'description.txt'
21
+written by Michael Ellerman
30
+perform a commit, and get
34
The ``shelve`` command interactively asks which changes
35
you want to retain in the working tree::
45
+written by Michael Ellerman
58
+perform a commit, and get
63
Shelve 2 change(s)? [yNfrq?]', 'y'
66
Changes shelved with id "1".
68
If there are lots of changes in the working tree, you
69
can provide the ``shelve`` command with a list of files
70
and you will only be asked about changes in those files.
71
After shelving changes, it's a good idea to use ``diff``
72
to confirm the tree has just the changes you expect::
75
=== modified file 'description.txt'
83
+written by Michael Ellerman
88
Great - you're ready to commit::
90
$ bzr commit -m "improve first sentence"
92
At some later time, you can bring the shelved changes back into the
93
working tree using ``unshelve``::
96
Unshelving changes with id "1".
98
All changes applied successfully.
100
If you want to, you can put multiple items on the shelf.
101
Normally each time you run ``unshelve`` the most recently
102
shelved changes will be reinstated. However, you can also
103
unshelve changes in a different order by explicitly
104
specifying which changes to unshelve.
106
Bazaar merges the changes in to your working tree, so they
107
will apply even if you have edited the files since you shelved
108
them, though they may conflict, in which case you will have to
109
resolve the conflicts in the same way you do after a conflicted