Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS Loses History when Merging

Both Team Foundation Server (TFS) 2005 and 2008 lose history (check-ins + comments) on files when they branched and merged back. So e.g. if changes in a branch are made then merged back to the root branch, none of the changes made in the branch are visible in the root branch. The only thing visible in the history states that a merge occurred.

Does anyone know if there is an option which can be set to retain the history, or a different way to do the merge which keeps the history?

like image 273
monibius Avatar asked Jul 15 '09 12:07

monibius


2 Answers

  • You are correct that TFS does not track history by default when merging. There is a powertool, however, that allows you to do so (see History Command under TFS Power Tool Commands).

  • See this comment for more details:

“If TFS would only maintain the history of branched files, rather than starting them from scratch every time a branch is done, then a similar safe merge would be possible between branches”

You can install the Power Tools and then use the /followbranches flag to retrieve the history information: http://msdn2.microsoft.com/en-us/vstudio/aa718351.aspx

History Command Use the history command to display the revision history for one or more files and folders. The /followbranches option returns the history of the file branch's ancestors.

There is also a codeplex project to enable the option in the GUI: http://www.codeplex.com/TFSBranchHistory

like image 89
Daniel F. Thornton Avatar answered Nov 09 '22 15:11

Daniel F. Thornton


TFS Branched History plugin for VS2010 is now available from Microsoft Gallery: http://visualstudiogallery.msdn.microsoft.com/7d4f37b6-f9a4-44c6-b0a0-994956538a44 This plugin is just query history from different branches and make union of the records.

like image 43
Maxim Vasiliev Avatar answered Nov 09 '22 16:11

Maxim Vasiliev