如果我的存储库包含许多解决方案,我可以为每个解决方案设置一个 .tfignore 文件吗?

Can I set a .tfignore file per solution if my repository contain many of solutions?

我的存储库中有 2 个解决方案:"A" 和 "B" 在 main\A 和 main\B 下 我要解决的问题是,当我更改 "A" 中的某些文件时,我可以看到这些文件并在我处理解决方案 "B".

时交付它们

我可以为每个解决方案设置一个 .tfignore 文件吗 并让它忽略当前解决方案之外不存在的所有其他文件?

如果 "A" 在 TFS 中有自己的构建定义,我可以强制更改集只包含 "A" 文件夹中的文件吗?

在这种情况下,您实际上应该做的是创建两个工作区,每个项目一个。然后您可以根据需要在工作区之间切换,并且只看到该工作区内更改的文件。

.tfignore 无法达到您的要求。您可以使用以下解决方法:

Best practice: A developer can check in pending changes limited to a given folder/branch/solution by right-clicking the folder/solution, choosing "Check in". For that check-in action, the "Pending Changes" view will temporarily "exclude" any changes made outside of that folder/branch/solution until you complete the check-in.

Can it be prevented: There is a premade Check-in Policy option known as "Enforce check-in to only contain files that are part of current solution". This may work for you, since you are using "Solutions".

更多详细信息请参考这个类似问题:Why does TFS allow a single changeset to affect multiple branches? If there isn't a very good reason, can this be prevented? and several ways 每个项目。