Shelving and Unshelving Pending Changes

The Teamprise Shelve/Unshelve task allows you to set aside pending changes in your TFS workspace if you want to work on something else for awhile, or if you want another teammember to review your changes before you commit them. When you create a shelveset TFS saves the items along with any associated Work Items or Check-in Notes to a separate repository, though not the source control repository itself.

Note: It's a good idea to make sure your workspace is up-to-date and that you have resolved any conflicts before creating a new shelveset.

Shelving a set of pending changes

You can shelve a set of pending changes from the Source Control menu or you can use the Pending Changes view:

  1. Click the down arrow icon in the Pending Changes view. From the popup menu click Shelve.

  2. In the Shelve - Source Files dialog, type a name for your shelveset, any comments, and, if necessary, deselect any file(s) you do not want to include in the shelveset. You can also associate a Work Item with your shelveset. For more information, see Associating Work Items with Changesets and Shelvesets.

    If you want the pending changes to persist in your local workspace after you create a shelveset, check the check box Preserve pending changes locally. If you wish to vacate all pending changes in your workspace after you create a shelveset, uncheck the check box so pending changes will be undone in your local workspace. This means, local files will revert to the previously checked in version. (But remember, your shelveset preserves your pending changes on selected files and you can unshelve them to your workspace at anytime.)

    When you are ready to check in your shelveset, click Shelve.

Unshelving a set of pending changes

To Unshelve a set of pending changes to your workspace:

  1. Right-click a directory in the Source Control view. From the popup menu click Unshelve Pending Changes... You can also access the Shelve/Unshelve command from the Teamprise Source Control menu.

  2. In the Unshelve dialog type the name of any team member with a TFS workspace and click Find to retrieve a list of all their shelvesets. In the example below we are retrieving one of our own shelvesets, and selecting the one we created above. Click Unshelve.

  3. The files in the shelveset are downloaded to the local workspace where they appear in the Pending Changes - Source Files channel as pending changes.

    Note: TFS does not allow you to resolve conflicts with a Merge operation on shelvesets. If you attempt to unshelve a set of pending changes into a workspace with edits pending on files that are saved in the Shelveset, you will recieve an error message and the Unshelve operation will be aborted. You must either undo, shelve, or check in the changes pending in your workspace before you can unshelve the shelveset.

    Viewing Shelveset Details

    To view details of a saved shelveset:

    1. In the Unshelve dialog, after you have completed your search (Steps 1 -2 above), right-click a shelveset from the list and select Details.

    2. In the Shelveset Details dialog, right-click a file and select from the popup menu. By selecting View, the shelved file opens in your Eclipse editor window where you can examine it before unshelving it. You also have the option to use the compare editor. For more information on this option, see Comparing versions.

    Deleting a Shelveset from the server

    To delete a Shelveset, locate the shelveset in the Unshelve dialog. Right-click the name and select Delete.


    Related Tasks:

    Associating work items with changesets
    View Pending Changes