I've been following the advice in "Team Development with Visual Studio Team Foundation Server" on structuring projects and sharing code from one team project into another using branching. So our source tree looks like this:
server\instance
Shared
share
Project1
Main
Product1
share (branched into Project1 from Shared)
Stories
1607
1832
Or at least it should.
As you can see, as well as branching in some shared code, we also use branch per user-story.
The problem is, when I try to branch in the share folder from the Shared project (Source Branch Name: $/Shared/share; Target Branch Name: $/Project1/Main/share), I get the error:
TF203028: You cannot create a branch at $/Project1/Main/share because a branch already exists at $/Project1/Main.
It is documented that you cannot nest branches in TFS, so the error is not surprising. Thus it appears that I am scuppered and the Team Development book is wrong. (The book implies that this should work.)
But appearances can be deceptive and I'm more likely to be wrong than the authors of the book. Can anyone help me understand how to fix this?
(One obvious solution would be to make the root of the story branches a sibling of share, rather than a parent. But this won't be any use to us, because it would mean that we would be unable to make changes to the shared code in a story branch, which rather defeats the object of branch per story. It would also mean a fairly colossal amount of work changing paths in the projects.)
I found the solution.
TFS showed a branch icon against Project1\Main, rather than a folder icon. I went to File>Source Control>Branching and Merging>Convert to Folder
and converted it back to a folder. I was then able to branch share into Project1.
Oddly, Main is still a point off which story branches are made, and those branches still exist.
The real solution was that I had to make the places where the shared code was branched into the project normal folders, rather than the branch icon. I went to File>Source Control>Branching and Merging>Convert to Folder
and converted it back to a folder. I was then able to create branches off Main.
The branch off Main, and the story branches retained their branch icons. share now looks like an ordinary folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With