Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force a merge in TFS after conflicts have been resolved

TFS 2010, VS 2010

We have a situation in TFS where a developer has not been following proper merge procedure. When I run a compare of his developer directory against trunk, I get a number of files marked as either different or not in trunk at all. The last merge/check-in to trunk was by him on 2011-05-26, and his last check-in to his dev branch was 2011-05-25.


I believe two things are going on:

  1. He isn't updating his dev branch from trunk properly (we require developers to merge trunk -> dev branch and compile before merging dev -> trunk)

  2. He isn't resolving merge conflicts correctly


The problem is that once he's marked conflicts as resolved, subsequent merges ignore those differences. I need to force a merge that revisits the differences from the whole file so that I can manually update every change he's made.

How can I do this?

like image 643
James King Avatar asked May 31 '11 16:05

James King


People also ask

How do I manually merge in Visual Studio?

In Visual Studio go to Tools --> Options and uncheck "Attempt to automatically resolve conflicts when they are generated" marked in red in the image. Show activity on this post. this will force a merge of the file to the newest workspace even if tfs thinks all changesets have been merged.

What is baseless merge in TFS?

Use baseless merge to merge items that are not directly branched from each other. To perform a baseless merge, you must use the tf merge command. When you perform a baseless merge, Team Foundation does not have any information about the relationship of the files in the branches.


2 Answers

You need to go to the command line and use tf merge /force e.g. tf merge $/TeamProject/DevBranch $/TeamProject/Trunk /force This should do what you want.

for more info try tf msdn which will open a browser and take you to the online help for the tf command tools.

/recursive fixes all and displays the GUI for conflicts.

like image 120
James Reed Avatar answered Sep 28 '22 04:09

James Reed


I found your answer and comments most helpful. I wanted to add that I needed to remove the /preview option to finally open the conflict resolution UI.

tf merge /recursive /force /version:C5367 "$/Source" "$/Target"
like image 39
Case 303 Avatar answered Sep 28 '22 04:09

Case 303