31

I've read in many places that renaming a branch is rather problematic in TFS 2010 : you may lose the history of the branch you just renamed ( as seen in this article or in this SO question )

I cannot find any mention of those problems in TFS 2012. Are there any consequences I should be aware of before renaming a branch in TFS 2012 ?

Community
  • 1
  • 1
tsimbalar
  • 5,790
  • 6
  • 37
  • 61
  • 2
    Can you cite these references? Because I'm not sure what you're referring to. (You won't lose history in any version of TFS.) – Edward Thomson Mar 20 '13 at 12:20

3 Answers3

41

The biggest problem with renaming a branch, is that you will effectively be performing a baseless merge next time you merge to or from the renamed branch. This can cause a lot of pain.

I'm currently trying to untangle such a mess at the moment and its not pleasant. (Branch was renamed 4 months ago. The first merge from the branch was partial) its a nightmare I wouldn't wish on my worst enemy (who coincidently are the devs who renamed the branch and did the partial merge)

See this answer for more info

Community
  • 1
  • 1
James Reed
  • 13,873
  • 51
  • 60
  • Thanks ! I'll accept your answer because of the details and reference to other answer – tsimbalar Jul 25 '13 at 13:08
  • 5
    To fix it... what I did was do a re-merge by changeset and selected all of the changesets except for the rename. It seemed to ignore the baseless feel and my merge was successful. – RiddlerDev Jul 25 '13 at 18:00
  • @RiddlerDev, thats a good idea. Unfortunatly that option wasn't available to me as the merges that messed everything (including the baseless) were already done. Plus the folder structure in the target branch had been reorganised so... lots of pain. – James Reed Jul 26 '13 at 09:27
15

DON'T DO IT!!! You might be able to rename it on the server, but from my experience TFS wants to check every file out... basically treating it like a copy.

RiddlerDev
  • 7,370
  • 5
  • 46
  • 62
0

You can do it, but depends what situation you're in. For my situation, I have the following structure:

Development
   ProjectX
      ProjectY
Main
Release

ProjectX is getting released sooner than ProjectY and it was merged to Development-->Main a week ago. Now, the name ProjectX isn't relevant anymore and also, there's a new project starting with a name ProjectZ so, I'm going to rename ProjectY to ProjectZ and rename ProjectX to ProjectY.

Both X, Y and Z are to be merged fully once they move to the standard release cycle so I don't have to worry about merging piece by piece.

Ostati
  • 4,623
  • 3
  • 44
  • 48