简体   繁体   中英

“Move” changeset in wrong TFS branch

Suppose that I check-in a change in the wrong TFS branch. I need to get my changes to a different branch then somehow eliminate those changes from the wrong branch. Can this be accomplished without resorting to selective copy/pasting? Eventually I do want my changes in the branch I mistakenly added them to... just not yet.

If I had not checked in the changes, I could shelve them, then use tfpt to unshelve into a different branch . But that won't work here, since I've already checked the changes in.


Example:

I have an environment with a MAIN and DEVELOPMENT branch. I need to create a new module, called Buzzsaw. I have a solution open and hack away on my changes. Then I check them in. Oops. I realize that I just checked my module into MAIN, but it should have been checked into DEVELOPMENT. I could rollback the mistaken changeset, but then I need to apply my changes to DEVELOPMENT manually. Most of the affected files are the same between the branches, but there are enough differences that I'd rather not copy/paste my changes.

I could merge my changes from MAIN to DEV, then rollback MAIN. But now it is difficult to bring the changes back to MAIN when I really do want them present (merging DEV to MAIN now doesn't move that changeset, since it was already merged).


What can I do? Is there a fairly clean way to accomplish this?

Merge from the wrong branch to the correct one, then do an changeset rollback of the one in the wrong branch.

Whenever you need, you still can merge back the changeset from the correct branch to the wrong one.

您可以“搁置”错误分支中的更改, 并将它们取消搁置到正确的分支中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM