简体   繁体   English

在TFS的分支中删除合并历史记录

[英]Delete merge history in a branch in TFS

Suppose I have a main branch and a dev branch. 假设我有一个main分支和一个dev分支。 Suppose I merge some stuff from dev into main. 假设我将一些东西从dev合并到main中。

  • I check in the merge 我检查合并
  • Now I decide "whoops, the dev branch wasn't really ready for me to merge into main yet." 现在,我决定“糟糕,开发分支尚未真正适合我并入main。”
  • I want to tell TFS: remove that change set from main and forget that the merge ever happened. 我想告诉TFS:从main中删除该更改集,而忘记合并曾经发生过。

Rolling back the changeset is easy enough -- I can use the TFS powertools ROLLBACK command. 回滚变更集很容易-我可以使用TFS powertools ROLLBACK命令。 on the Main branch (with the /changeset /recursive flags) 在Main分支上(带有/ changeset / recursive标志)

However, I will get a warning from the rollback that the merge history for the files has not been deleted. 但是,我将从回滚中得到一个警告,指出该文件的合并历史记录尚未删除。

Effect: Later, when dev is ready to be merged into main, the changes in the files that were rolled back previously are NOT merged into Main (this is because TFS "thinks" that those merges are already done. 效果:稍后,当准备好将dev合并到main中时,先前回滚的文件中的更改不会合并到Main中(这是因为TFS认为这些合并已经完成。

My goal: When I rollback, make TFS remove the merge history so that when I merge dev into main later on, everything merges. 我的目标:回滚时,使TFS删除合并历史记录,以便以后将dev合并到main中时,所有内容都合并。

How can I do that? 我怎样才能做到这一点?

BTW: I'm using TFS 2008 SP1 顺便说一句:我正在使用TFS 2008 SP1

Rollbacks in TFS 2008 aren't that great. TFS 2008中的回滚并不是那么好。 It is essentially a re-check-in of a previous version. 它本质上是对旧版本的重新签入。 Since you lost that merge history, you may need to /force the merge from the command line when you do the merge next time. 由于您丢失了该合并历史记录,因此当您下次进行合并时,可能需要从命令行/force进行合并。 That should get it to ignore the fact that the previous merge history is out there. 应该得到它忽略了一个事实,以前的合并历史就在那里。

I ran into a similar problem. 我遇到了类似的问题。 One thing I think might help you is the tf.exe merge /discard option. 我认为可能对您有所帮助的一件事是tf.exe merge / discard选项。 What this allows you to do is perform a fake merge of files and remove the change from the merge history without actually performing the merge. 这使您可以执行伪造的文件合并,并从合并历史记录中删除更改,而无需实际执行合并。

http://msdn.microsoft.com/en-us/library/bd6dxhfy(v=vs.80).aspx http://msdn.microsoft.com/en-us/library/bd6dxhfy(v=vs.80).aspx

Hopefully that helps! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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