Git 如何忽略除文件夹外的某些扩展名为的文件?

Git 如何忽略除文件夹外的某些扩展名为的文件?,git,gitignore,Git,Gitignore,我有一个.gitignore文件,我想在其中忽略所有bin文件夹和所有pdb文件,除了helper folderbellow,在这个helper文件夹中,我想保留所有内容: [Bb]in/ *.pdb !project/helper/ 所有pdb文件和bin文件夹仍被排除在文件夹之外,我还尝试了: !项目/助手/* !项目/助手 !project/helper/。 甚至 !project/helper/foo* 提前谢谢。这对我来说很好: *.php !/web/sites/ !/web/

我有一个.gitignore文件,我想在其中忽略所有bin文件夹和所有pdb文件,除了helper folderbellow,在这个helper文件夹中,我想保留所有内容:

[Bb]in/
*.pdb

!project/helper/
所有pdb文件和bin文件夹仍被排除在文件夹之外,我还尝试了:

!项目/助手/* !项目/助手 !project/helper/。 甚至

!project/helper/foo*
提前谢谢。

这对我来说很好:

*.php

!/web/sites/
!/web/sites/*.php
!/web/sites/default/
!/web/sites/default/*.php

谢谢你的帮助,我们试过了,但没有成功!project/helper/*/bin/*/!project/helper/bin/*/*.pdb