{"id":5343,"date":"2005-01-19T09:25:00","date_gmt":"2005-01-19T09:25:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/buckh\/2005\/01\/19\/how-to-use-shelving-from-the-command-line\/"},"modified":"2005-01-19T09:25:00","modified_gmt":"2005-01-19T09:25:00","slug":"how-to-use-shelving-from-the-command-line","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/buckh\/how-to-use-shelving-from-the-command-line\/","title":{"rendered":"How to use shelving from the command line"},"content":{"rendered":"<p>Shelving is a really useful feature that was included for the first time with the Dec. CTP.&nbsp; Shelving allows you to save your changes to a shelveset on the server.&nbsp; The shelveset consists of the same kind of information that a checkin does, except that you aren&#8217;t checking in.&nbsp; You don&#8217;t create a new changeset.&nbsp; Rather, you create a space on the server that is your own that contains your pending changes, comment, etc.<\/p>\n<p>You can choose to move your changes out of your workspace or you can keep your pending changes when you shelve.&nbsp; Moving your changes is great when you need to stop working on your current changes, make a targeted fix, check in that fix, and then unshelve what you were working on before being interrupted.&nbsp; Keeping your changes in your workspace is very useful when you want share a change (perhaps a fix for another developer prior to checkin) or have another person review your changes.<\/p>\n<p>I&#8217;ll talk more about how works in upcoming posts.&nbsp; For now, here are some commands you can use to explore shelving in the Dec. CTP.<\/p>\n<p>Bring up a Visual Studio command prompt (Start -&gt; All Program -&gt; Microsoft Visual Studio 2005 Beta -&gt; Visual Studio Tools -&gt; Visual Studio Command Prompt), cd to a workspace directory with some pending changes, and try out some of the following.&nbsp; If you need to create a workspace, you can create one with &#8220;h workspace \/new MyWorkspace \/s:<em>yourtfsservername<\/em>&#8221; and then pend some changes.<\/p>\n<p>To shelve all of your changes in your current workspace, use<br>&nbsp;&nbsp;&nbsp; h shelve MyShelvesetName [optional filespecs]<\/p>\n<p>To unshelve an existing shelveset, use<br>&nbsp;&nbsp;&nbsp; h unshelve MyShelvesetName [optional filespecs]<\/p>\n<p>To shelve the changes and undo them in your workspace, use the \/move option with \/i (or uncheck &#8220;Preserve my changes&#8221; in the GUI).&nbsp; The \/move option also deletes pending adds since they get uploaded to the server &#8212; something a plain undo doesn&#8217;t (and can&#8217;t) do.<br>&nbsp;&nbsp;&nbsp; h shelve \/i \/move shelvesetname [optional filespecs]<\/p>\n<p>To delete a shelveset, use the shelve command.<br>&nbsp;&nbsp;&nbsp; h shelve \/delete shelvesetname<\/p>\n<p>To see the changes in another user&#8217;s shelveset, use the status command (when the other user is in the same domain, you should be able to leave that off).<br>&nbsp;&nbsp;&nbsp; h status \/shelveset:shelvesetname;domainuser<\/p>\n<p>To see the diffs for a shelveset, use the diff command (great for remote code reviews).<br>&nbsp;&nbsp;&nbsp; h diff \/shelveset:shelvesetname;domainuser<\/p>\n<p>You can also see a list of all shelvesets with shelvesets command<br>&nbsp;&nbsp;&nbsp; h shelvesets \/owner:*<\/p>\n<p>&nbsp;<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shelving is a really useful feature that was included for the first time with the Dec. CTP.&nbsp; Shelving allows you to save your changes to a shelveset on the server.&nbsp; The shelveset consists of the same kind of information that a checkin does, except that you aren&#8217;t checking in.&nbsp; You don&#8217;t create a new changeset.&nbsp; [&hellip;]<\/p>\n","protected":false},"author":94,"featured_media":10268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[6,8],"class_list":["post-5343","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-source-control","tag-team-foundation"],"acf":[],"blog_post_summary":"<p>Shelving is a really useful feature that was included for the first time with the Dec. CTP.&nbsp; Shelving allows you to save your changes to a shelveset on the server.&nbsp; The shelveset consists of the same kind of information that a checkin does, except that you aren&#8217;t checking in.&nbsp; You don&#8217;t create a new changeset.&nbsp; [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/5343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/comments?post=5343"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/5343\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media\/10268"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media?parent=5343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/categories?post=5343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/tags?post=5343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}