为什么所有文件都标有“合并”? 在 TFS 中?
我正在将我的开发分支合并到主分支中。 我在开发分支中仅更改了一部分文件,所有其他文件应保持不变。 从逻辑上讲,我只想合并已更改的文件。 我不会签入我没有更改的文件。
但是当我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这种情况也会发生在无根据的合并中。 当 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
.可能的原因有很多。 这不是完整列表:
标记为“合并”的文件
注:所有这些都同样适用于 2005 年和 2005 年。 2008年。
There are a number of possible reasons. This is not a complete list:
files marked "merge"
Note: all of these apply equally to 2005 & 2008.
在 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.