17

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?

Kiquenet
  • 14,494
  • 35
  • 148
  • 243
James King
  • 6,233
  • 5
  • 42
  • 63

2 Answers2

17

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.

Kiquenet
  • 14,494
  • 35
  • 148
  • 243
James Reed
  • 13,873
  • 51
  • 60
  • How are conflicts resolved when run from the command line? Is there still a windowed component to let me merge these visually? – James King Jun 01 '11 at 15:44
  • 1
    Yes, you need to start the process from the command line but any conflicts are resolved using the GUI. It may be worth using the /preview option from the command line as well. This will give you an idea of what the merge will do. – James Reed Jun 01 '11 at 16:36
  • I can't seem to make it work... I had to cd to the development directory from the command line to get tf to figure out the correct server... but no matter how I try to specify the version (required for /force), it seems to be trying to merge the very first version in the dev branch – James King Jun 03 '11 at 15:02
  • 1
    tf merge /force /preview /version:C197309 $/CSA/Dev/Workflow $/CSA/Trunk/Source results in merge: $/CSA/Dev/Workflow;C3614~C3614 -> $/CSA/Trunk/Source;C3602 Also, no GUI appears... do I launch Visual Studio to work with the changes? – James King Jun 03 '11 at 15:04
  • @JamesReed - in case you get a moment: http://stackoverflow.com/questions/33003274/revoking-tfs-merge-credits – RobVious Oct 07 '15 at 22:41
10

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"
Case 303
  • 538
  • 10
  • 24