如何将新文件合并到 TFS 中的另一个分支? [英] How to merge new files into another branch in TFS?

查看:24
本文介绍了如何将新文件合并到 TFS 中的另一个分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,在 TFS 中,我们有一个主 trunk 分支和另一个分支,我们称之为 次要.我们在 trunk 中创建了一个新文件,但是当尝试合并该特定文件时,它没有为我们提供合并到 secondary 分支的选项.我们假设这是因为二级中不存在类似文件.

Ok, in TFS we have a main trunk branch and another branch, let's call it secondary. We have created a new file in the trunk but when trying to merge that specific file, it does not give us the option to merge to the secondary branch. We're assuming that it's because an analagous file does not exist in secondary.

这是问题的原因吗?如果是,我们如何将新文件从 trunk 获取到 secondary?

Is this the cause of the problem and if so, how can we get that new file from the trunk into secondary?

在这里,我们正在合并 secondary 中确实存在的文件.如您所见,下拉列表列出了我们所有的三个分支(secondary 实际上是中间的一个):

Here, we are merging a file that does exist in secondary. As you can see, the dropdown lists all three of our branches (secondary is actually the middle one):

现在,当我尝试合并在 secondary 分支后在 trunk 中创建的文件时,secondary 不再列为目标分支.

Now, when I try to merge a file which was created in trunk after secondary was branched, secondary is no longer listed as a target branch.

推荐答案

我认为这应该可以通过 VS GUI 实现,如下所示:

选择添加新文件的文件夹并订购合并 (整个文件夹)到您的次要 分支.
现在该文件夹的所有更改文件都出现在您的待处理列表+您的新文件中.
撤消所有其他文件 &继续只签入一个重要的文件.

I think this should be possible over the VS GUI as follows:

Select the folder where the new file was added and order a merge (of the whole folder) to your secondary branch.
Now all changed files of the folder appear in your pending list + your new file.
Undo all other files & proceed with checking in only the one file that matters.

有人可能会争辩说,TFS 的这种限制实际上是有道理的:

One could argue that this restriction of TFS in fact makes sense:

  • 如果您对文件进行了额外的更改,您将受到保护,不会破坏您的二级分支.
  • 如果您没有对任何其他文件进行额外更改,合并您的文件仍然有意义,因为合并将只包含您的新文件.

这篇关于如何将新文件合并到 TFS 中的另一个分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆