There's a config file in the branch I want to merge to that is locked against ordinary developers changing it, but the branch I'm working in needs it to be different. So now I have a changeset with that one file in it. I want to discard that as a merge candidate from there to the other branch. When I issue tf merge /discard
against it, I end up with a pending change to the target — but when I try to check that in, it complains that the target is locked for check-in by the administrator (which is the whole reason I wanted to discard the merge in the first place!). How can I proceed?

- 1,371
- 13
- 24
2 Answers
Atario, check out my answer to this question. For your case, if you set up your workspace in the target branch (the one you are performing the merge with) to cloak that one file, it will no longer show up as a merge candidate in that workspace. If you never want to merge to that file from any branch, I would suggest that you pull it out of the branch mappings.

- 1
- 1

- 3,084
- 18
- 27
-
I can't get your cloak-a-single-file trick to work. The dialog has the text fields read-only, so I can't add the filename after the folder name. Trying the tf command instead, it takes the cloak entry, but this seems to have no effect on the merge candidate list anyway, and the file still displays normally in the UI. (I should add that I'm using VS2008, if that has any bearing.) – Atario May 09 '12 at 17:53
I can't guarantee this will work, but it's what I'd try (I usually find that doing things with simple every day operations works better than trying to figure out obscure options you rarely get a chance to try out):
Turn off the protection on the locked branch (A), apply the merge operation from branch B to A, (if you don't want to keep the changes, then during the merge, just keep the code as it was). Then check in the "merged" file even if it has no actual change. Then restore the protection.
Ths should make TFS think that it has done the merge and the results were checked in (not discarded), and therefore it should no longer think that file is unmerged.

- 56,972
- 11
- 108
- 137