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.
Before you can complete this walkthrough, you must:
Specify a server that runs Team Foundation Server. For more information about how to connect to Team Foundation Server, see How to: Connect to Team Foundation Server.
Open an existing team project. For more information, see Walkthrough: Joining a Team Project.
Add the project to version control. This creates a local workspace where you can store, edit, and test your version-controlled files.
Create a Visual Studio solution and then perform a version control check-in on it. For more information, see Adding Projects and Solutions to Version Control from Solution Explorer.
If you are not familiar with these prerequisite steps, we recommend that you review Walkthrough: Exploring Team Foundation Version Control first.
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
Open your solution in Visual Studio.
In Solution Explorer, right-click your solution and select Get Latest Version (Recursive).
If there are any conflicts, you will have to resolve them. For more information, see How to: Resolve Conflicts Between Two Files.
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
In Solution Explorer, right-click and select Shelve Pending Changes.
The shelve option is also available in Source Control Explorer.
In the Shelve - Source Files dialog box, type shelvetest in the Shelveset name box.
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.