Git忽略子文件夹 [英] Git ignore sub folders

查看:163
本文介绍了Git忽略子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的.Net解决方案中有很多项目。我想排除所有bin / Debug和bin / Release文件夹(及其内容),但仍包含bin文件夹本身以及其中包含的任何dll。



.gitignore和bin /忽略调试和发布文件夹,但也包含bin文件夹中包含的任何dll文件。

bin / Debug或bin / Release不会排除这些目录,除非我将忽略模式完全限定为Solution / Project / bin / Debug - 我不想这样做,因为我需要在我的解决方案中包含每个项目的完整模式,以及添加任何新项目添加它。



有什么建议?
<您尝试过通配符吗?

 解决方案/ * / bin / Debug 
解决方案/ * / bin / Release

您还可以使用 ** 通配符匹配任何级别的子目录:

  ** / bin中/调试/ 
** / bin / Release /


I have a lot of projects in my .Net solution. I would like to exclude all "bin/Debug" and "bin/Release" folders (and their contents), but still include the "bin" folder itself and any dll's contained therein.

.gitignore with "bin/" ignores "Debug" and "Release" folders, but also any dll's contained in the "bin" folder.

"bin/Debug" or "bin/Release" in the .gitignore file does not exclude the directories, unless I fully qualify the ignore pattern as "Solution/Project/bin/Debug" - which I don't want to do as I will need to include this full pattern for each project in my solution, as well as add it for any new projects added.

Any suggestions?

解决方案

Have you tried wildcards?

Solution/*/bin/Debug
Solution/*/bin/Release

With version 1.8.2 of git, you can also use the ** wildcard to match any level of subdirectories:

**/bin/Debug/
**/bin/Release/

这篇关于Git忽略子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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