TFS Automatically Merge Without Checking Conflicts

Asked

Viewed 336 times

1

We 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 checking the version, that is, it does not say whether there are conflicts or not, it simply goes up the version and completely replaces the previous one.

Can anyone tell why this occurs? It’s some TFS configuration?

Thank you.

1 answer

2

There is no automatic merge in any merge tool. Because it is the developer who should make the decision of which code should be versioned. So if you changed a code and checked in, there was no merge, but simply a version of the code, that is, 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. This 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 one is given the merge name.

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

See the image below:

A imagem acima mostra a tela de escolha para o merge

You can choose a line or two in the Visual Studio merge tool, using the checkbox next to the source (1) and target (2), or even edit the line in the result frame.

To get to this screen, you will see a warning in Team Explorer the following warning:

"Pull completed with conflicts..." é a mensagem que avisa sobre ser preciso resolver conflitos

Clicking on the link Resolves the Conflicts:

Listagem dos arquivo com conflito

The list of conflicting files will be shown in Team Explorer again, if you want to fully overwrite a file just choose between Take Remote or Keep Local, if it is necessary to verify the code and use part of one with another click on the button Merge.

IMPORTANT: Keep Visual Studio updated, in the 2013 version there was a bug in relation to the Merge button, it was necessary to make a workaround so that he would be enabled when a conflict arose.

  • is just this option to choose which code snippet will be inserted at check-in, it does not appear, I am not available this screen Accept Merge.

  • I added this part, see if this solves your doubt

  • "There is no automatic merge in any merge tool." exists in Git, which is done in three phases. What changes is when both source and destination have a conflicting change that requires user resolution.

  • No, in Git what you’re calling an automatic tool is Fast Forward, but the process doesn’t happen on the server, but on the client. That is, it is still not automatic I have to "want" to merge, it happens on the developer’s machine, but FF is a shortcut that solves something I would not need to interact. When I say it doesn’t exist at all it’s because the check-in or commit is never done and solved directly, you need to execute an intermediate step.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.