Take the 2-minute tour ×

We have a project that is in TFS 2010 and was incorrectly branched. We want to fix it. This is the current structure we have:

  • Development
  • Integration
  • Main

The problem is that Main is a branch of Integration, which in turn is branch of Development, when it should be the very opposite.

In other words, first it was created Development, then branched Integration and then Main.

Now all three branches have same code (were merged).

So, Is it possible to fix the TFS references to have the right flow: Main -> Integration -> Development?

share|improve this question
The relationships are more important than the order of branch creation. For all intents and purposes Dev -> int -> main is the same as Main -> int -> dev. You can always reparent the branches is its a problem but practically there's no difference –  James Reed Aug 18 '13 at 14:22
add comment

1 Answer

up vote 2 down vote accepted

As far as I know, there is no way to make this change behind the scenes. The problem you have in hand is that the Development and Main branches are out of place. Easiest thing to fix this would be to rename the "Development" branch as "Main" and vice-versa or Use the REPARENT option as shown at the end of the answer.

Am assuming that in your case since you have only one DEV branch (it wouldnt be possible to have more than 1 dev with the current branching structure), the development for the next release wont happen till the current release is out in production right? In that case, you can wait till the end of the current release and then rename the branches, so that all the 3 branches are in sync before the rename.

(Keep in mind that "Rename" changeset would affect all the files and folders in your branch, and from the comments below I can understand that it can be very problematic if you do it at the wrong time. Choose your time very wisely, make sure that you dont have any changes pending between the branches and it's just the "Rename" changeset thats pending between branches)

Another approach would be to use REPARENT. After a great discussion in the comments below, I tried the options myself and the best way to fix this would be to use the "Reparent" option. I tried this out myself by creating three different branches. You can do the following to fix it:

  1. In Visual Studio, Click on the Main branch -> then File -> Source Control -> Branching and Merging -> Reparent. Select "No Parent" and then click "Reparent"

  2. Click on the INT branch -> then File -> Source Control -> Branching and Merging -> Reparent. Select "Main" and then click "Reparent".

  3. Click on the DEV branch -> then File -> Source Control -> Branching and Merging -> Reparent. Select "INT" and then click "Reparent".

share|improve this answer
can you please explain why this was down voted? –  Isaiah4110 Aug 18 '13 at 14:45
1. Renaming branches will cause a whole host of problems 2. pointnetdeveloper can create multiple dev branches, by branching them from "Int". 3. Creating new branches is unnecessary. There isn't anything wrong with the relationships between the branches, Dev -> int -> Main is effectively the same as Main -> int -> Dev. the only practical difference is that the branching visualisation will show things the wrong way round. This can be fixed using "reparent" –  James Reed Aug 19 '13 at 10:21
I agree that renaming can cause problems, but if you do it at the right time it should be just fine. Not in the middle of a release, but at the beginning when everything is in sync and we have just the "rename" changeset. In that case, a merge would ensure everything works good. Your link which says a branch after rename will cause "baseless merge" is wrong. Only the items where the content differs between the source and target since the last merge will be baseless merged, not the entire branch! –  Isaiah4110 Aug 19 '13 at 14:08
I agree that even though names are different, relationship is the same. But for all intents and purposes at a working environment, you cannot keep "Main" as "DEV" and vice-verse. This could create lot of confusion among developers. "Reparent" option again has to deal with a baseless merge. So I dont know how that is better –  Isaiah4110 Aug 19 '13 at 14:58
Your comment makes no sense, it's the name of the branches and the relationships that are important. Not the parent child relationships. Main is main because that's what it's called. "Main as dev" makes no sense at all. Reparent has nothing to do with baseless merges, it just changes the parent child relationships for the visualisation it doesn't affect the way a merge will be performed in any practical way –  James Reed Aug 19 '13 at 20:42
show 6 more comments

Your Answer


