TFS Automatic Merge without Check Conflicts

1

We have recently installed TFS 2012 to control the versions of some local systems, but we are facing a problem.

When you are asked to check in a file that has been changed, it is saved in TFS without verifying the version, ie it does not tell you if there is a conflict or not, it simply goes up and replaces the previous one.

Does anyone know why this happens? Is it some TFS configuration?

Thank you.

    
asked by anonymous 05.04.2017 / 00:54

1 answer

2

There is no automatic merge in any merge tool. For it is the developer who must make the decision of which code should be versioned. So if you changed a code and checked in, a merge was not done, but simply a versioning of the code, ie a new version of it was saved.

At check-in TFS will tell you if there is a conflict when someone changes the same line of code that is being sent to the server. That would be a merge. For when two developers change the same code it is necessary to choose which lines or parts of it will be versioned. This choice, which can be part of a change from one developer and part of the other, is called merge.

If the version that is on the server is the one that was previously downloaded and changed, there is no conflict. So, as said before, there is no merge, so it looks like TFS does something automatically, but it's not true.

See the image below:

YoucanchooseonelineortheotherintheVisualStudiomergetool,usingthecheckboxesnexttosource(1)andtarget(2),orevenedittherowintheresultframe.

Togettothisscreen,youwillseeawarninginTeamExplorerfollowedbyawarning:

" Pull completed with conflicts ... "is the message that tells you that you need to resolve conflicts

Clicking on the Resolve the conflicts link:

The list of conflicting files will be shown again in Team Explorer, if you want to overwrite a file entirely, just choose Take Remote or Keep Location if necessary check the code and use part of one with another click the Merge button.

IMPORTANT : Keep Visual Studio up to date, there was a bug in the Merge button in the 2013 version, you had to do a workaround so that it would be enabled when a conflict appeared.

    
05.04.2017 / 07:13