PyCharm 2016.3 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 PyCharm, 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.

Shelving changes

  1. In the Local Changes tab of the Version Control Tool Window tool window, select the files or changelist to put to a shelf. On the main Version Control menu or on the context menu of the selection, choose Shelve changes.
  2. In the Shelve Changes dialog box, review the list of changed files and make sure that the files you are going to shelve have been checked out.
  3. In the Commit Message text box, type the comment to identify the shelf where the changes will be stored.
  4. Click Shelve changes.

Automatically shelving base revision

If you are using Git or Mercurial, it may be useful to have PyCharm always shelve base revisions of files that are under version control.

By default, PyCharm 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.

  1. Open the Settings dialog box, and select the Version Control node on the left.
  2. Select the Store on shelf base revision texts of files under DVCS check box.

See Also

Last modified: 23 December 2016