为什么所有文件都标有“合并”? 在 TFS 中?

发布于 2024-07-26 00:34:27 字数 313 浏览 9 评论 0原文

我正在将我的开发分支合并到主分支中。 我在开发分支中仅更改了一部分文件,所有其他文件应保持不变。 从逻辑上讲,我只想合并已更改的文件。 我不会签入我没有更改的文件。

但是当我在 TFS 中执行合并操作时,它会用更改类型“合并”标记树中的每个文件。 看起来我必须签入整个源代码树中的每个文件! 我真的不想这样做,因为这样就不可能查看变更集并查看我在项目中实际更改了哪些文件。

起初,我以为我可以使用 tfpt.exe Undo Unchanged 命令来撤消所有“合并”更改,但这不会撤消这些更改。

有人对此有什么想法吗? 谢谢。

I am merging my development branch into the main branch. There is only a subset of files that I have changed in my development branch, all other files should remain unchanged. Logically, I only want to merge files which I've changed. I would not check in a file which I did not change.

But when I do the merge operation in TFS, it marks every single file in the tree with change type 'merge'. It looks like I must checkin every single file in the whole source code tree! I really do not want to do this becasue then it becomes impossible to look at the changeset and see what files I acctually changed as part of my project.

At first, I thought I could use the tfpt.exe Undo Unchanged command to undo all the 'merge' changes, but this won't undo those changes.

Anyone have any ideas on this? thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤寂小茶 2024-08-02 00:34:27

这种情况也会发生在无根据的合并中。 当 TFS 在您要合并的分支之间不存在现有合并关系时,就会发生无基础合并。 因此,它认为两个分支中的每个文件都是“新的”,因此它“合并”每个文件。

要创建合并关系,以便将来的合并仅列出您实际更改的文件,您需要对指定版本之前的所有更改进行无基础合并,以便 TFS 知道公共基线应该是什么。 您应该合并这些更改之后执行此操作 - 现在纠正此分支的基线为时已晚。

如果您实际上不想从其他分支获取任何更改,而只是告诉 TFS 这些在逻辑上处于同一版本,则可以对更改集进行合并“给予信用”:tf merge /discard< /代码>。

This also happens with a baseless merge. A baseless merge occurs when TFS doesn't have an existing merge relationship between the branches you're merging. As a result, it considers every file 'new' in both branches, so it 'merges' every file.

To create a merge relationship, so that future merges only list the files that you've actually changed, you need to do a baseless merge of all changes up to a specified version so that TFS knows what the common baseline should be. You should do this after merging these changes - it's too late to correct the baseline for this branch now.

If you don't actually want to take any changes from the other branch, but just tell TFS that these are logically at the same version, you can do a merge 'giving credit' for the changesets: tf merge /discard.

长不大的小祸害 2024-08-02 00:34:27

可能的原因有很多。 这不是完整列表:

  • 您在该文件夹的父文件夹上执行了命名空间操作(删除、取消删除、重命名)
    标记为“合并”的文件
  • 您执行了已在目标分支中执行的名称空间操作(删除、取消删除、重命名)
  • 您执行了一系列名称空间操作,这些操作合并为无操作(例如,删除 + 取消删除,或重命名 - > b -> a)
  • 存在未解决的冲突,
  • 您执行丢弃

注:所有这些都同样适用于 2005 年和 2005 年。 2008年。

There are a number of possible reasons. This is not a complete list:

  • You performed a namespace operation (delete, undelete, rename) on a parent folder of the
    files marked "merge"
  • You performed a namespace operation (delete, undelete, rename) that had already been performed in the target branch
  • You performed a sequence of namespace operations that collapsed into a no-op (eg delete + undelete, or rename a -> b -> a)
  • There are unresolved conflicts
  • You performing a discard

Note: all of these apply equally to 2005 & 2008.

绮烟 2024-08-02 00:34:27

在 Visual Studio 2008 和 TFS 2008 中,不会发生这种情况。 只有已更改的文件才会被标记为合并。 如果您对分支和主干之间的文件进行比较,是否有任何变化? 编码等更改仍会使 TFS 合并此文件。

In Visual Studio 2008 and TFS 2008, this does not occur. Only files that have changed will be marked as merge. If you do a compare of a file between the branch and the trunk are there any changes? Changes such as encoding will still make TFS merge this file back.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文