How do I delete a folder in a branch of TFS, but n

2019-08-08 06:26发布

问题:

We need to delete a folder in one of our branches, but do not want it deleted in the main/root repository. The deleted folder is gone in ONE older version, but the newer versions retain it, as do the older versions.

I deleted it in the branch, merged to main, then in main did "undo pending changes" on that folder. The problem is each new merge to main, it wants to delete that folder again. How do I tell it to leave it in the main/root?

回答1:

To prevent a changeset from being merged, you need to discard it. This is done from the Command Prompt.

The following example discards changeset 137 as a candidate for merging into branch2.

tf merge /discard /version:C137 branch1 branch2 /recursive