如何在TFS中分支和合并

问题描述:

此问题是上一个问题的衍生版本:

This question is a derivative of a previous question: How to version resources that are shared across projects

我有一个项目,其中包含许多其他项目使用的代码.具体来说,该父项目中的一个文件夹已分支到相关的子项目.

I have a project that contains code that is consumed by many other projects. Specifically, one folder in this parent project has been branched to dependent child projects.

此后,我们在父项目中进行了更改并签入.在Source Control Explorer中,我右键单击父项目中的分支文件夹,然后选择合并",以将更改推送到从属项目中.我选择子项目作为目标,然后选择最新版本".向导通知我没有要合并的更改".

We have since made changes in the parent project and checked them in. In Source Control Explorer, I right click on the branched folder in the parent project and select "Merge", intending to push the changes to a dependent project. I select the child project as a destination and then select "Latest Version". The wizard informs me "There are no changes to merge."

在我看来,这是不正确的,因为最近更新的文件明显不同.

From my perspective, this isn't true, since the recently updated files are clearly different.

在这里,对TFS中的合并过程是否存在根本的误解?我需要做些什么不同的事情?

Is there a fundamental misunderstanding of the merge process in TFS here? What do I need to do differently?

TFS合并引擎几乎完全依赖于历史记录,而不是文件内容.这对于大型树木而言非常有效,对于灵活地进行樱桃采摘更改等任务则非常灵活-但也使回答您的问题变得困难.

The TFS merge engine relies almost entirely on history, not file contents. This makes it efficient for very large trees, and flexible for tasks like safely cherry-picking changes -- but it also makes answering your question difficult.

第一步是了解诊断命令 tf历史记录,tf合并 tf合并/候选.这是一个很好的介绍:

The first step is to understand the diagnostic commands tf history, tf merges, and tf merge /candidate. Here is a good introduction: http://blogs.msdn.com/dstfs/archive/2009/04/15/a-note-on-merging-and-the-use-of-tf-merges-tf-merge.aspx

如果您不熟悉分支&合并到TFS中,那么您的历史记录可能不会很复杂.我认为您可以通过快速调用 tf merges 找到答案.但是,在一般情况下,跟踪合并历史记录会变得非常复杂,因此,如果您有麻烦,请随时发回详细信息.

If you are new to branching & merging in TFS then your history is probably not very complex. I think it's likely you'll find your answer with one quick call to tf merges. However, tracing merge history can become extremely convoluted in the general case, so if you have trouble feel free to post back with more details.