Unshelving TFS shelveset to a different location or branch

  1. Install Microsoft Visual Studio Team Foundation Server 2013 Power Tools, then open command line and cd into a location where you have your TFS workspace otherwise TFTP will show error
    C:\Windows\System32>tfpt unshelve
    Unable to determine the workspace.
  2. Run tfpt unshelve /?
    c:\Source\Project\tfpt>unshelve /?
    tfpt unshelve - Unshelve into workspace with pending changes
    
    This command has two separate modes of operation:
    
    1. Migrate: allows migration of shelved changes from one branch into another
       by rewriting server paths.
    
    2. Undo: allows changes from an already-unshelved shelveset to be undone,
       cleaning up pending adds, and preserving other existing pending changes in
       the workspace.
    
    Usage: tfpt unshelve /migrate /source:serverpath /target:serverpath
                         [shelvesetname[;username]] [/backup]
    
           tfpt unshelve /undo shelvesetname[;username] [/batchsize:num]
                         [/recursive] [filespec...]
    
     shelvesetname          The name of the shelveset to unshelve
     /backup                Creates a backup shelveset
     /migrate               Rewrite the server paths of the shelved items
                            (for example to unshelve into another branch)
     /source:serverpath     Source location for path rewrite (supply with /migrate)
     /target:serverpath     Target location for path rewrite (supply with /migrate)
     /undo                  Undo pending changes from an unshelved shelveset
     /batchsize:num         Set the batch size for server calls (default 500)
  3. The option you need to execute is unshelve /migrate. Specify /source, /target and shelvesetname – that should be enough. You may need to resolve conflicts, in most cases AutoMerge in the pop up dialog will do the trick.

 

One thought on “Unshelving TFS shelveset to a different location or branch

  1. Wakazula

    SYMPTOM
    “unable to determine the workspace”

    SOLUTION
    a. from the Windows command prompt `CD` to the source directory
    b. now execute the before mentioned `tfpt.exe` migration command

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *