Using Shelvesets to Set Aside Pending Changes (Team Explorer Everywhere)

By creating a shelveset, you can set aside a batch of pending changes from a workspace temporarily. You can later restore those changes into your workspace or into the workspace of another user, or you can delete the changes. For more information, see Pending Changes.

Common Tasks

Task

Supporting content

Understanding shelvesets: Learn how shelvesets and changesets differ and in what kinds of scenarios you might want to use shelvesets.

  • The Difference Between Shelvesets and Changesets

  • Scenarios in Which to Consider Shelving

Set aside pending changes: You can create shelvesets from the following locations:

  • Package Explorer or Project Explorer by using the Team menu.

  • The code editor by right-clicking in the editor and then using the Team menu.

  • Source Control Explorer.

  • The Pending Changes window.

  • The Cross-platform Command-Line Client for Team Foundation Server by using the tf shelve command.

Find and restore shelvesets: You can find shelvesets by owner, view details, and then unshelve a shelveset. When you unshelve all changes in a shelveset to a workspace, the pending changes information with which the items are associated is also restored to the Pending Changes window. You must use the Unshelve command to restore a shelveset.

When you unshelve a shelveset, Team Foundation Server restores each shelved revision into the destination workspace as a pending change unless the revision conflicts with a change that was already pending in the workspace.

  • Edits - Team Foundation Server copies the contents of the source workspace version into the destination workspace version and checks out the file for edit.

  • Deletions - Shelved files and folders that were deleted before they were checked in to the source workspace are deleted in the destination workspace.

  • Additions - Shelved files and folders that were added to version control pending check in to the source workspace are added to the destination workspace.

  • Renames and Moves - Shelved files and folders that were renamed or moved in the source workspace are renamed and moved into their new folders in the destination workspace.

Important noteImportant
To unshelve an item, no pending revisions against it must occur in the destination workspace.

You can compare one or more revisions of a file in a shelveset with the file's base shelveset version, which is the version of the file as it exists on the server. To perform this comparison, you can use either the Unshelve command in the Team Foundation Server plug-in for Eclipse or the Difference Command at a command prompt.

Delete shelvesets: You can delete shelvesets from the server for Team Foundation version control. Conversely, changesets are permanently stored in the server. You can also delete a shelveset after you restore it into a workspace.

The Difference Between Shelvesets and Changesets

When you check in one or more of the pending changes in your workspace, Team Foundation Server creates a changeset in the server for version control. Changesets and shelvesets are both groups of source file revisions, check-in notes, a comment, and links to associated work items that are stored on the version-control server. Any user who has sufficient permissions can retrieve changesets and shelvesets into a workspace. However, shelvesets do not contain the versions of committed file changes.

Changesets and shelvesets also differ in the following ways:

  • Unlike a changeset, a shelveset is a nonversioned entity. If you unshelve the items of which a shelveset consists, edit several files, and then reshelve the shelveset, Team Foundation Server does not create another version of the items for future comparison. The server maintains no record of who revised the items, when, or in what manner. The original shelveset is replaced.

  • You can delete a shelveset but not a changeset.

  • You can link a changeset to a work item so that a user can display details about the changeset by clicking a link on the form for that work item. You cannot link a shelveset to a work item.

  • By creating and enforcing check-in policies, you can prevent (or at least strongly discourage) users from creating changesets that do not comply with established team standards. Evaluation of check-in policies for shelvesets is optional. Therefore, users could create shelvesets that bypass established team standards.

Scenarios in Which to Consider Shelving

You shelve your pending changes when you are not ready to or cannot check in a set of pending changes, as in the following scenarios:

  • Interruption - You can shelve your pending changes to set them aside if you are not ready to check them in but you must work on a different task.

  • Integration - You can shelve your pending changes and ask your team member to unshelve them if you are not ready to check in but you must share changes with another team member.

  • Review – You can shelve changes that must undergo a code review before you check them in. After you create the shelveset, you inform the code reviewer, who can then unshelve and review your changes.

  • Backup – You can shelve changes that you want to back up before you are ready to check them in. By creating a shelveset, you copy the changes to the version-control server.

  • Handoff – You can shelve changes that are in progress before you hand them off to another member of the team for completion.

See Also

Other Resources

Using Version Control (Team Explorer Everywhere)

Working with Changesets (Team Explorer Everywhere)