Source Control Shelving and Unshelving

Shelving is very powerful feature of the Source Control in VSTS that allows storing pending changes without checking them into Source Control. This is useful when we are working on changes but not able to finish them up before required check in process. We simply shelve these changes for the time being. When we are ready to proceed with further development, we can unshelve those files and safely complete our work that can be checked into the source control at the end of the day. There are many other reasons you may consider shelving files:

  • Interruption of your work
  • Integration of all files
  • Code Reviews
  • Backup process
  • Handoffs

When we shelve file or files, we can provide comments and other meta data. All these data is stored inside our Source Control and is called shelveset. Shelvset is a non-versioned unlike changeset and as a result, any new shelvset that is created will completely replace existing shelvset. You can also delete shelvset from the Source Control. Other limitations of shelvsets are: cannot link to a work item and bypass any check-in policies.

Shelving folder of files can be done in several ways. We can shelve pending changes via Source Control Explorer, Solution Explorer, Pending Window changes or command line. We’ll examine most common way of doing it in more details which is Solution Explorer shelving.

In order to shelve pending changes, we need to have file checked out with any changes done to it. We need right-click on it and select “Shelve Pending Changes”.

Some description 
Shelve and Unshelve

The next window prompts us confirm files being shelved.

Confirm Shelved 
Confirm Shelved

The next windows asks us to provide shelvset name and comments as well as choice of deselecting files from shelving if not required.

Some description 
Shelve Files

Unshelving is very similar to shelving. All we need is to select from “File” menu item called “Source Control” and then click “Unshelve”.

Some description 
Unshelve File

Pressing on Unshelve button will initiate process or retrieving file from the Source Control and Checking out all files affected by this Unshleving for editing.

Featured pages

SharePoint Integration

Windows SharePoint Services is an integral part of Team Foundation Server. As a result, there is v…

Creating Team Project

Team Foundation Server allows creation of the portal project via TFS Portal Creation Wizard. This …

SQL Server Agent Jobs

Team Foundation Server installs several SQL Server Agent Jobs that allow it to perform certain tas…

tf Command

tf Command line utility provide many useful operations that we can perform with Team Foundation Se…

Shelving and Unshelving

Shelving is very powerful feature of the Source Control in VSTS that allows storing pending change…

MS Project Fields Mapping

TFS works with MS Project via mapping file with specific fields mapped from one application to ano…

Using MS Project with Team Foundation Server

MS Projects allows accessing Team Foundation Server and working with the TFS Work Items. This is a…

Managing Documents in TFS

Team Foundation Server provides us with the capability to manage various documents, also called ar…