TFS Loses History when Merging

tfs, version-control

Solution

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

Problem

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?

Original source