How does merging work in TFS 2010?

When I merge files from one branch to another, and then proceed to check the files in the target branch, you have selected MANY files, only those that have changed. For example, the main and critical branches were the same, and we only made changes to 2 or 3 files on the Critical Fix branch. Then I merged Critical ==> Main, and when I went to check for changes in the Main Branch, I noticed that a lot of files were checked, not just 2 or 3, which were actually changed in the Critical Fix branches. Moreover, when I compare the file with the main branch to one on the server, they tell me that the files are identical. If the files are identical, why are they checked? Any help would be appreciated or even a link that explains how to merge TFS 2010.

+4
source share
3 answers

The standard tools for merging with source files in Visual Source Safe, and then TFS, have always been rather poor - they are often confused by the simplest changes, they often find identical files as “changed”, and the auto-reset frequency often fails (includes incorrect changes). I quickly learned about the distrust of these merge tools (around 1995) and since then I have not seen any evidence in any new releases that the kernel merge algorithms have been improved at all.

The good news is that you can replace client-side merging tools with third-party ones (I use one that works so well that I really trust its automatic merge option). I once spent 2 days trying (and failing) to make a difficult merger with TFS tools and, in the end, buy this third-party tool and re-earn all the merge in 15 minutes!)

The bad news is that the first step of merging branches simply uses the TFS merge code, and therefore it is very confused, which led to the symptoms you described. This disappoints such a key feature of such an expensive application, because it spends a lot of time for the programmer on each merge to fix imaginary “conflicts” - on the positive side, using third-party tools, as a rule, it is very easy to reliably resolve these merging problems.

+2
source

One thing that I noticed is that when a single file changes in different branches, which leads to the exact same content, then merging puts it as a conflict, since the file changes in both places. Of course, in a different kind of file it is indicated that there are no changes, and therefore automatic merging will solve this automatically for you.

0
source

I had the same problem. I created a branch of our DEV branch and made changes to several files. I checked my changes and merged the latest changes in DEV into my branch. After the merge, all 30,000+ files in my branch were marked as modified. Like cju, I found that comparing most of the files showed that no changes were made.

I decided to undo all the changes and try again. When I right-clicked the solution and chose Cancel, I got a message that one file had changes, was I sure that I wanted to cancel this file? I clicked “No to all,” and when the undo operation was completed, all the files were changed, only the files that were changed during my merge with DEV. This was exactly what I wanted, so I checked these changes in my branch and continued to work.

I hope others can correct their situation as easily as I could.

0
source

Source: https://habr.com/ru/post/1332678/


All Articles