More often than wanted, it's necessary to stop what you were working on and work on something else. For example a serious problem needs immediate dealing with and you have to stop working on the new feature. If possible, you should commit the changes you have done so far and then start working on the urgent issue, but often those changes would break the build or are just not ready for committing yet.

So if you can't commit your local changes yet, you have to put them aside while you're working on the urgent issue. The shelving feature helps you do exactly that: you can store your local changes on a shelve, get your working copy in a clean state again and work on the issue. After you're finished with the urgent issue and you've committed those changes, you can unshelve your shelved work and continue working on your previous task again.

Two new commands are implemented for this. One for shelving and one for unshelving.

To shelve your local changes, select your working copy and use Context MenuShelve The following dialog allows you to select the files you want to shelve and give a name under which you want to store them.

Figure 4.16. Shelve dialog

Shelve dialog

Then click OK and the changes are stored under the name you specified, and your working copy is reset to a clean state.

To unshelve your changes, use Context MenuUnshelve to get the unshelve dialog. This dialog shows you a list of all shelved items. Select the shelved item you want to apply back to your working copy and click OK.

Figure 4.17. Unshelve dialog

Unshelve dialog


Shelves are purely a local client feature. Creating and removing Shelves will not affect the repository, nor anyone else's working copy.


Currently only text files can be shelved and unshelved. Binary files and text files encoded in utf-16 (unicode) can not be shelved.