2
votes

I have a situation where I wants to create a new branch for one of my breaking changes under my project. But when I looked at the existing structure available on my TFS project, I see no way to create new branch.

Let me know if there is any possible way to create a new branch that work with this structure.

I have gone through the TFS doc: https://docs.microsoft.com/en-us/azure/devops/repos/tfvc/branch-folders-files?view=azure-devops But it's not much helpful.

You can see the attached image for reference. (Main problem is that there is no root folder under my default collection from what I see at the moment, correct me if I am wrong.)

enter image description here

2

2 Answers

2
votes

You could create a new folder with main name in the root of your team project.

Then move all your project folders, files into that main folder. Move in TFS will perform an action delete + add. But your source control history will still keep, only be folding.

enter image description here

Then you could simply convert that main folder to branch. Now you have a main branch with all your old project files.

Next step should directly branch your main branch with a child call feature. You could directly work with your breaking changes on the feature branch. After work finished, merge feature branch with new changes back to main branch.

Or you could also choose to create a child of feature branch. Then work with changes on feature's child branch. Detail branch structure based on your needs.

0
votes
  1. Create a new Team Project(DefaultCollection-Branch1).

  2. Right click on DefaultCollection-Branch1 > Branching and Merging > Convert to branch.

  3. Right click on DefaultCollection > Branching and Merging > Merge > Choose Target to be DefaultCollection-Branch1

  4. Right click on DefaultCollection-Branch1 > Branching and Merging > Reparent, choose DefaultCollection (notice that it says branch relationship is merge).