Wednesday, 26 November 2008

Branching in TFS

Ahhh... I think I know what you're running into.

Are you getting "The target item $/foo/sub cannot be under the source item $/foo"?

Basically, we don't allow you to branch everything in a folder to a subfolder of itself. The branch itself would work, but subsequent merges would get...messy.

The way to deal with this is to create a single top-level folder directly under your team project (so, if your Team Project is "foo", put all of your source in something like "$/foo/Main"); then, if you need multiple branches within the team project, you can branch $/foo/Main to $/foo/a, or $/foo/a to $/foo/a.1, etc.

Let me know if that will work for you or not; or especially if you're seeing some other error when you attempt your branch.