Visual Studio 2015 - Go to another branch in TFS

I checked some files from the main section of our code installed in TFS. A separate branch was later created. I would like to check my code on a new branch, although I initially checked it from the original one. Is it possible?

EDIT: I know that I can register on the main branch and merge, but I would like to avoid this if possible.

+6
source share
3 answers

Well, it depends on which version control you use.

If you use GIT , it is simple. Once you have created a new branch in the user interface, you just need to β€œcheck” the new branch. Any uncommitted changes will automatically point to a new branch. Then you can fix them.

If you use TFVC , you need to postpone the changes in the source branch and delete them on another branch . This function is provided using the tfpt unshelve /migrate command. More detailed steps, please ask a question: TFS: post changes made locally in one branch to another branch

This is also a sample that shows the difference between GIT and TFVC.

+7
source
  • Install TFS 2015 Power Tools

  • Create shelves of your changes

  • Open the developer command line

  • Use the tfpt unshelve /migrate command as such

    tfpt unshelve /migrate /source:$/Project/Branch1 /target:$/Project/Branch2

+7
source

I could not use the answers using Power Tools, so I registered on the source branch, merged into the target and rolled back from the source branch.

0
source

All Articles