什么是“排除变更"?在 Team Foundation Server 中? [英] What are "Excluded Changes" in Team Foundation Server?

查看:30
本文介绍了什么是“排除变更"?在 Team Foundation Server 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 Visual Studio 2013 Professional 在 TFS Express 2013 中签入更改时,有一个排除的更改"列表,其中包含 1541 个项目.

When I check in changes in TFS Express 2013 using Visual Studio 2013 Professional, there is a list of "Excluded Changes" that has 1541 items in it.

我从未告诉 TFS 排除更改,并且不明白为什么有人甚至想要排除"更改(源代码控制不都是关于保存更改吗???).我有点担心我有没有被保存的更改......但我什至不确定这是否是它的意思.我在 Google 上搜索了有关 TFS 中排除的更改"的更多信息,但没有找到任何解释.

I have never told TFS to exclude a change, and do not understand why anyone would even want to "exclude" a change (isn't source control all about SAVING changes???). I am a bit worried that I have changes that are not being saved...but am even unsure if this is even what it means. I have Googled for more information about "Excluded Changes" in TFS, but haven't found any explanation.

谁能向我解释一下:什么是排除的更改?为什么我要排除更改?为什么有 1541 个我从未要求排除的已排除更改?我是否应该担心更改被排除在外?我应该将这些排除的更改更改为包含的更改吗?

Can anyone explain to me: What are Excluded Changes? Why would I want to exclude a change? And why are there 1541 excluded changes that I never requested to be excluded? Should I be worried that changes are being excluded? Should I change these excluded changes to INCLUDED changes?

推荐答案

有很多事情可以导致改变"排除:

There are a number of things that can cause a "change" to be excluded:

  1. 默认情况下,Team Explorer 将忽略 obj/*bin/* 以及一些其他文件夹中的文件.以及某些扩展名,例如 .csproj.user.
  2. 它们未加载到您当前的解决方案中,因此团队资源管理器假定它们是作为不同解决方案的一部分制作的,并且您不希望将它们与与您的上下文匹配的更改一起检入'重新进入.
  3. 它们是在不同的工作区中创建的,同样,团队资源管理器假定您要签入逻辑上有意义的文件组.
  4. 他们已从当前签入中手动排除.如果您想先签入一个修复了错误 123 的文件,然后签入另一组修复了错误 124 的文件,您可以这样做.
  5. 绝不会自动添加在 Visual Studio 之外创建的文件,因此当您压缩一组 .cs 文件并且该 zip 最终位于您的工作区文件夹中时,团队资源管理器会检测到它,但不会自动添加它.
  6. 这里可能存在最后一个问题,如果由于某种原因项目尚未添加到源代码管理中,或者解决方案文件中的绑定未正确签入,则将任何文件添加到该项目也将被忽略,因为 Visual Studio 假定该项目不应受源代码控制.
  7. 使用添加现有项目"不会自动将该项目置于与解决方案相同的源代码管理绑定下.这将导致团队浏览器假设 6.
  8. 该路径之前可能已被隐藏"过;或未映射",事后映射文件夹不会告诉团队资源管理器添加它们.
  9. 您可能一直在脱机工作并且正在使用服务器工作区.当您告诉团队资源管理器重新联机时,您需要确保所有添加都正确完成.本地工作区不存在此问题,因为它可以在本地跟踪更改,而无需与服务器通信.
  10. 您可能选择了签入待定更改";来自解决方案资源管理器(或单个项目或项目)或源代码管理资源管理器中的子文件夹.当您这样做时,团队资源管理器将 Pending Changes 窗口的范围限定为仅匹配该上下文的项目.所有其他更改都暂时移至排除的更改"部分.部分.
  1. Team Explorer will, by default, ignore files in obj/* and bin/* and a few other folders. As well as certain extensions like .csproj.user.
  2. They're not loaded in your current solution, so Team Explorer assumes they're made as part of either a different solution and that you don't want to check them in together with the changes that do match the context you're in.
  3. They're made in a different workspace, again Team explorer assumes you want to check in groups of files that logically make sense.
  4. They're manually excluded from the current checkin. You may do that when you want to first check in one file that fixed Bug 123, then check in another set of files that fixed Bug 124.
  5. Files created outside of Visual Studio are never automatically added, so when you zip up a set of .cs files and that zip ends up in your workspace folder, Team Explorer will detect it, but won't add it automatically.
  6. There is a final issue that may be going on here, if for some reason a project hasn't been added to source control, or the bindings in the solution file were not checked in correctly, then any file added to that project will be ignored as well, as Visual Studio assumes that project should not be under sourcecontrol.
  7. Using "Add existing project" doesn't automatically put that project under the same source control bindings as the solution. which would cause team explorer to assume 6.
  8. The path may previously have been "cloaked" or "unmapped", mapping a folder after the fact doesn't tell Team Explorer to add them.
  9. You may have been working offline and were using a server workspace. When you tell Team Explorer to come back online, you need to ensure that all adds are correctly done. A Local workspace doesn't have this issue, as it can locally track the changes without having to talk to the server.
  10. You may have chosen "Check in pending changes" from a subfolder in the Solution Explorer (or on an individual item or project) or in the Source Control Explorer. When you do that, Team Explorer scopes the Pending Changes window to only the items that match that context. All other changes are temporarily moved to the "Excluded Changes" section.

您应该检查 Excluded Changes 列表并使用 .tfignore 文件忽略它们.您也可以在 UI 中执行此操作,方法是右键单击此类已排除的更改并选择按路径/扩展名或模式忽略的选项.

You should inspect the Excluded Changes list and either ignore them using your .tfignore file. You can do this from the UI as well by right-clicking such an excluded change and choosing the option to ignore by path/extension or pattern.

基本上,如果您在排除的文件"部分看到内容,请右键单击/包含它们或将它们添加到您的 .tfignore 文件中.

Basically, if you see stuff in the Excluded Files section, either right-click/include them or add them to your .tfignore file.

这样至少很清楚,该列表中的项目尚未评估,很可能需要包含在内.

That way it's at least very clear that items in that list have not been evaluated yet and most probably need to be included.

您可能还想通过打开 File/Source Control/Advanced/Change Source Control Bindings 来检查您的源代码管理绑定... 确保所有项目都显示为绑定到源代码控制并且不显示任何错误.

You may also want to check your source control bindings by opening File/Source Control/Advanced/Change Source Control Bindings... to ensure that all projects show as bound to sourcecontrol and don't show any errors.

在 Git 以及其他源代码控制系统中,更改通常不会自动挂起.这是为了防止您意外签入您不打算签入的内容.在 Git 中,您需要显式调用 git add 将更改标记为您打算提交的更改.除非您这样做,否则更改将被视为未跟踪",这本质上是排除的更改".TFVC 的特点.

In Git as well as in other source control systems, changes are often not automatically pended. This is to prevent you from accidentally checking in stuff that you did not intend to. In Git you need to explicitly call git add to mark a change as one that you intend to commit. Until you do that the change is considered "untracked", which is essentially the "Excluded Changes" feature of TFVC.

Subversion (SVN) 具有类似的行为,其中更改的文件被标记为 unversioned,需要通过调用svn add显式添加.

Subversion (SVN) has a similar behavior where changed files are marked as unversioned and need to be added explicitly through calling svn add.

所以对于源代码控制系统来说,这并不是很奇怪的行为.它基本上让控制您的来源.

So this isn't very strange behavior for a source control system. It essentially puts you in control of your sources.

这篇关于什么是“排除变更"?在 Team Foundation Server 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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