Let’s talk shelving. Not the kind you try to build in your garage that never fits together, and not a bunch of milk cartons stacked on each other. I’m talking about source control shelvesets. Think of them as a snapshot of your local workspace at a given time. We use them a lot in many different projects. MSDN has a nice article about their usefulness here.
Why is this useful? My main reasons are for interruptions, like “Can you get the latest code and see if those changes worked?”. When you are in the middle of something yourself, this can be a dangerous step to take. If I shelve my current workspace, I can look at their changes then revert back to my old workspace copy. It’s also nice to share code without checking it into the entire repository. Another person can pull down that shelveset to check it out. It’s also a must have for backups. If I’m ever thinking of making a lot of drastic changes, I’ll shelve first so I can revert anything I broke.
You can shelve pending changes (like a local check in) by right-clicking a file/project/folder/etc. and selecting Shelve Pending Changes.
If you want to get your shelveset back or get other people’s shelved changes. Go to File -> Source Control -> Unshelve Pending Changes….
You can then find shelvesets by username. Clicking Details on a shelvset will show you information about each file in that shelveset. You can also compare files from this window.
Clicking Unshelve will pull the changes back into your working copy.
Shelving is a powerful way to handle many situations with source control. Hope it helps you!