Move Shelveset from One Branch to Another

This can be useful if you start working on the wrong branch and need to move your uncommitted code to the correct branch.

-You will need to have the TFS Power Tools installed.
-Make sure the path of your command prompt on your project path
eg. c:\TFS\Rick.Wilson\Web Resources
-Get latest on the source and target branches to avoid this error: "Unable to determine the workspace."
-Create your shelveset and make sure you don't have any pending changes in either branch to avoid this error: "An item with the same key has already been added" 

-Shelve your changes
-Open a Visual Studio Command Prompt
-Run the following command

tfpt unshelve /migrate /source:"$/Project/CurrentBranch" /target:"$/Project/NewBranch" "Shelveset Name"

-A shelveset details window will come up, click the Unshelv button.
-Next the Unshelv/Merge window will come up, click the Auto-merg button.
 The command prompt will then start showing the merges into the new branch.


Popular posts from this blog

Add User As Local Administrator On Domain Controller

Calling Dataverse Web API in PowerShell using Client Credentials

Windows Server 2008R2 VMs Shut Down After 1 to 2 Hours