IntelliJ IDEA 14.0.0 Web Help

Shelving Changes

On this page:

Basics

Shelving is temporarily storing not yet committed changes in a dedicated shelf. This may be helpful, for example, when you need to switch to another urgent task, but you are short of time to bring your current code to a certain condition.

With IntelliJ IDEA, you can shelve both entire changelists or separate files.

Once shelved, a change can be applied as many times as you need by unshelving and subsequently restoring it on the shelf.

When using Git or Mercurial integration, it may be useful to have IntelliJ IDEA always shelve the base revisions of files that are under Git or Mercurial version control.

By default, IntelliJ IDEA always "remembers" the last commit hash. However, this information is not sufficient if the history has been changed since the last commit as a result of running the Rebase operation. In this case, having a copy of the base revision may help.

Shelving changes

To shelve changes

  1. In the Local tab of the Changes tool window, select the files or changelist to put to a shelf.
  2. On the main Version Control menu or on the context menu of the selection, choose Shelve changes.
  3. In the Shelve Changes dialog box, review the list of changed files and make sure that the files to be put to a shelf are checked out.

    You can specify the desired changelist immediately in the dialog box: from the Changelist combo box, select the desired changelist.

  4. In the Commit Message text box, type the comment to identify the shelf where the changes will be stored.
  5. Click Shelve changes.

Shelving base revision automatically

To have base revision shelved automatically

  1. Open the project settings and click Version Control.
  2. On the Version Control page, select the Store on shelf base revision texts of files under DVCS check box.

See Also

Last modified: 4 December 2014
comments powered by Disqus