简体   繁体   English

在 Visual Studio 2019 解决方案资源管理器中筛选以显示被 Git 忽略的文件

[英]Filter To Show Files Ignored By Git In Visual Studio 2019 Solution Explorer

In Visual Studio 2019 when using git, files that are.gitignored have a red circle icon in Solution Explorer to indicate this.在 Visual Studio 2019 中,当使用 git 时,被 .gitignored 的文件在解决方案资源管理器中有一个红色圆圈图标来指示这一点。 Is there a way I can filter the Solution Explorer to see only these files?有没有办法可以过滤解决方案资源管理器以仅查看这些文件?

An extension would be an acceptable solution in my case if necessary.如有必要,在我的情况下,扩展将是一个可接受的解决方案。

I have three suggestions, none of which are exactly what you need but each of which just might provide some help...我有三个建议,没有一个是你真正需要的,但每一个都可能提供一些帮助......

  1. Write your own filter solution using this example as a start: https://docs.microsoft.com/en-us/visualstudio/extensibility/extending-the-solution-explorer-filter?view=vs-2019使用此示例编写您自己的过滤器解决方案作为开始: https://docs.microsoft.com/en-us/visualstudio/extensibility/extending-the-solution-explorer-filter?view=vs-2019

  2. If it's possible to create a naming convention for your ignored files, then you can use the Solution Explorer's search text box (above the Solution tree) to filter by a string the includes your naming convention prefix/suffix, for example.如果可以为您忽略的文件创建命名约定,那么您可以使用解决方案资源管理器的搜索文本框(在解决方案树上方)按包含您的命名约定前缀/后缀的字符串进行过滤。

  3. If you have a large number of files you're excluding from Git then perhaps it's possible to place them all in their own folder--even if that folder remains in your solution tree (and perhaps it shouldn't?).如果您有大量文件要从 Git 中排除,那么也许可以将它们全部放在自己的文件夹中——即使该文件夹保留在您的解决方案树中(也许不应该?)。 That would make it possible to view them all in one place rather than need to filter everything in Solution Explorer--and is undeniably more convenient when it comes to managing those Git-ignored files.这样就可以在一个地方查看所有内容,而无需在解决方案资源管理器中过滤所有内容——不可否认,在管理那些被 Git 忽略的文件时更方便。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2019-使用PowerShell打开文件而不是解决方案资源管理器 - Visual Studio 2019 - Use PowerShell to open files instead of Solution Explorer Visual Studio Community 2019 中的解决方案资源管理器如何刷新? - How can the Solution Explorer in Visual Studio Community 2019 be refreshed? 如何运行 Visual Studio 解决方案而无需在解决方案资源管理器中添加包含的文件显示? - How to run a Visual Studio solution without having to add the included files show in the Solution Explorer? Visual Studio 2019 - 在解决方案资源管理器中查找不在源代码管理中的项目 - Visual Studio 2019 - Find items not in source control in Solution Explorer Visual Studio 未在解决方案资源管理器中显示已提交的文件 - Visual Studio not showing committed files in Solution Explorer 在Visual Studio中的解决方案资源管理器中组织项目文件 - Organizing project files in Solution Explorer in Visual Studio Visual Studio解决方案资源管理器中的快捷方式(.lnk)文件 - Shortcut (.lnk) files in Visual Studio Solution Explorer Visual Studio SQL文件在解决方案资源管理器中不可见 - Visual Studio SQL files not visible in Solution Explorer SCSS文件未在Visual Studio中的解决方案资源管理器中分组 - SCSS files not grouped in Solution Explorer in Visual Studio Visual Studio 2013解决方案资源管理器不显示文件 - Visual Studio 2013 Solution Explorer Not Showing Files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM