Walkthrough: Shelving Version Control Items

This walkthrough shows you how to use the shelving feature in Team Foundation version control.

By shelving items, you can temporarily set aside a group of pending changes. This allows you to work on another high-priority release or to share your untested file revisions with another user. The output of a shelve operation is a shelveset. For more information, see Working with Version Control Shelvesets.

Prerequisites

Before you can complete this walkthrough, you must:

If you are not familiar with these prerequisite steps, we recommend that you review Walkthrough: Exploring Team Foundation Version Control first.

Required Permissions

To complete this walkthrough, you must have the PendChange and CheckIn permissions.

Shelve Folders and Files in Team Foundation Version Control

The following procedures show you how to shelve a solution. This lets you temporarily set aside the pending changes in your workspace. You can also use a shelve action to share your code with another user for code review.

Before you shelve your changes, you should perform a Get Latest operation. This will synchronize your workspace with the latest server version. Then you should build your application to make sure that it compiles before you shelve it or check it in. Doing this lets you incorporate changes to files that have been modified outside your workspace. For more information, see How to: Update File Versions in Your Workspace.

To get the latest items and build your project

  1. Open your solution in Visual Studio.

  2. In Solution Explorer, right-click your solution and select Get Latest Version (Recursive).

    Note

    If there are any conflicts, you will have to resolve them. For more information, see How to: Resolve Conflicts Between Two Files.

  3. On the Build menu, click Build Solution. Be sure that your solution builds without errors.

Next, create a shelveset. The following procedure assumes that you have a solution with pending changes.

To shelve folders and files in version control

  1. In Solution Explorer, right-click and select Shelve Pending Changes.

    Note

    The shelve option is also available in Source Control Explorer.

  2. In the Shelve - Source Files dialog box, type shelvetest in the Shelveset name box.

  3. In the Comment box, type Testing my shelveset, and then click Shelve.

    Team Foundation copies the files and folders to the version control server. These files and folders are now available for other team members to unshelve. For more information, see How to: Shelve and Unshelve Pending Changes.

See Also

Tasks

How to: Shelve and Unshelve Pending Changes

Concepts

Working with Version Control Shelvesets

Working with Version Control Workspaces

Reference

Shelvesets Command

Shelve Command

Unshelve Command

Other Resources

Team Foundation Version Control Walkthroughs