Search code examples
tfsvisual-studio-2017branchtfvc

Create branch from main with local changes included, or create branch from shelveset


I have been working in our main branch for some time, but now realize the changes were more comprehensive and should be developed in a dev branch instead.

Therefore, I want to create a dev branch from our main branch with my local modifications in main moved to that branch. There seems to have been a way with older versions of VS and TFS, using tfpt commands, but I cant find out how to accomplish this with newer environments, I have VS2019 professional on my machine, and we are using TFS 2017. (The old solution was described here).

If the procedure described previously could be adopted with modifications or with a nice hack, a How-to for that would of course be highly appreciated.


Solution

  • As you said, the tftp command is part of Visual Studio Power Tools that doesn't exist for VS 2019.

    As workaround, you can do this:

    1) Copy all the changed files to another location (locally).

    2) Undo pending changes.

    3) Create the new branch.

    4) Delete the changes file locally and copy there the new files (that you backed up in step 1).

    5) Check in the changes.