3

I understand that when performing a merge from BRANCHA > BRANCHB and selecting “Keep Target” on some files will result in “Merge Credits” being granted to those files in TFS history: Merging Developement Branch to Main: There were no changes to merge

Is there a way for us to revoke/wipe the Merge Credits on given files, effectively enabling our developers to perform a /force merge via Source Control Explorer?

Context:

On a weekly basis, we merge from BRANCHA > BRANCHB to synchronize parallel efforts. Any files with unresolved conflicts are noted and their owners are notified to perform a merge on those files from A > B. We then select “Keep Target” on these files – anticipating a future merge by the file owner to resolve the pending conflict. We’re delegating the work out to the individual owners.

This doesn’t quite work though, because TFS will see that the initial merge has “resolved” the conflict (basing its evaluation on prior merge history, not file contents).

I want to enable developers to perform re-merges on these files without forcing them to use the command prompt and /force switch.

Moving forward, my plan is to “Undo Changes” on those pending changes that were selected as “Keep Target” before checking in a branch>branch merge. This will enable the devs to perform the merges independently by dodging the merge credits.

But looking back, a branch<>branch /force merge results in hundreds of conflicts that we would like to delegate out to the owners as a means of syncing up two branches. Performing a classic merge reports nothing on these because prior merges have “Kept Target”.

1
  • Undo pending changes is indeed the way to go. Alternatively, your developers can rollback the merge you did for just the files noted, check that in and perform the merge again. Rollback will revert the merge credit. Oct 8, 2015 at 12:36

1 Answer 1

7

You're indeed better off undoing the merge for the specific files you don't want to merge right now, but once you've chosen keep target, TFS indeed remembers that choice.

If you're already past the point of committing the merge, there is a way to get rid of the ticket, and that is to roll back the merge. You can roll back the merge for a group of individual files.

The trick here is as follows:

  1. Look up each file and them in the Source Control Explorer.
  2. Right-click the individual file and from the context menu choose to Rollback.... enter image description here
  3. Enter the changeset number of the merge enter image description here
  4. Repeat 1 to 3 until you have all the file in your list.
  5. Check-in this compensating changeset.
  6. Try merging Branch A to Branch B again, your candidate changes should show up again.

You can do the same thing from the commandline, using tf rollback (pre-2015) or tf vc rollback (post-20215)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.