DEV Community

Cover image for Sparky's Tool Tips: TFS Auto Shelve
Brian Schroer
Brian Schroer

Posted on • Edited on

Sparky's Tool Tips: TFS Auto Shelve

This may be the most useful tool I've blogged about, and probably the simplest...

TFS Auto Shelve for Visual Studio is a Visual Studio 2019 extension that periodically shelves pending changes to Team Foundation System or Azure DevOps source control.

I can't count how many times I've used it to retrieve code files I've accidentally deleted, or files where I've started making changes and saved my mind and wanted to "roll back" to a previous version that hadn't been checked in.

You use the Visual Studio "Tools | Options | TFS Auto Shelve" menu to configure how often you want to shelve, how many shelvesets to keep, and how they should be named.
TFS Auto Shelve Options

The name is defined using placeholders, and the default name is "Auto-{0}":

  • {0}: WorkspaceInfo.Name (machine name for me - I'm not sure if it's something different for other installations)
  • {1}: WorkspaceInfo.OwnerName
  • {2}: DateTime.Now
  • {3}: Domain of WorkspaceInfo.OwnerName
  • {4}: UserName of WorkspaceInfo.OwnerName

You can retrieve shelved files via the Visual Studio "File | Source Control | Find | Find Shelvesets" menu:

"Find Shelvesets" window, showing shelvesets saved by TFS Auto Shelve

(I've used my incredible graphic skills😉 on the screenshot to block out information specific to the company where I work.)

You can see from the screenshot above that there were no shelvesets created overnight or over the weekend. Iit's smart enough to only create them while you're actively using Visual Studio.

The extension adds two items to the Visual Studio "Team" menu. The first shows you whether the extension is running, and the second lets you create an on-demand shelveset:

Teams / TFS Auto Shelve Visual Studio menu

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️