Get Tfs Shelveset file contents at the command prompt?

前端 未结 6 1148

I\'m interested in getting the contents of a shelveset at the command prompt. Now, you would think that a cmdlet such as Get-TfsShelveset, available in the TFS Power Tools,

6条回答
  •  庸人自扰
    2020-12-18 03:59

    Spent a few days trying to do this as well, this always popped up on google so here is what I found to help future generations:

    To get the contents of the shelveset (at least with Team Explorer Everywhere),
    use the command: tf difference /shelveset:

    That will print out the contents of the shelveset and give filenames in the form :
    : ; C
    Shelved Change: ;

    So if your file is contents/test.txt
    in the shelveset shelve1 (with base revision 1), you will see :
    edit: $/contents/file.txt;C1
    Shelved Change: $/contents/file.txt;shelve1

    After that, using the tf print command
    (or view if not using TEE) on $/contents/file.txt;shelve1 should get you the contents :

    tf print $/contents/file.txt;shelve1

    Shows you what is in the file.txt in shelveset shelve1

提交回复
热议问题