Re-including a file that "is several subdirectories below the ignored directory" (as you try) does not work because "it is not possible to re-include the file if the parent directory of this file is excluded" [ source ].
As an ugly but working solution, re-include all the parent directories along the path before re-including the file you want, saving the files in these parent directories and excluding them again.
For your example, this would look like this:
web/[Ee]xample.[Ww]eb/[Ss]itecore/* !web/[Ee]xample.[Ww]eb/[Ss]itecore/[Ss]hell/ web/[Ee]xample.[Ww]eb/[Ss]itecore/[Ss]hell/** !web/[Ee]xample.[Ww]eb/[Ss]itecore/[Ss]hell/[Tt]hemes/ web/[Ee]xample.[Ww]eb/[Ss]itecore/[Ss]hell/[Tt]hemes/** !web/[Ee]xample.[Ww]eb/[Ss]itecore/[Ss]hell/[Tt]hemes/[Ss]tandard/ web/[Ee]xample.[Ww]eb/[Ss]itecore/[Ss]hell/[Tt]hemes/[Ss]tandard/** !web/[Ee]xample.[Ww]eb/[Ss]itecore/[Ss]hell/[Tt]hemes/[Ss]tandard/[Cc]ustom/ web/[Ee]xample.[Ww]eb/[Ss]itecore/[Ss]hell/[Tt]hemes/[Ss]tandard/[Cc]ustom/** !web/[Ee]xample.[Ww]eb/[Ss]itecore/[Ss]hell/[Tt]hemes/[Ss]tandard/[Cc]ustom/32x32*
Source: my answer is here .
Alternatively , you can use .gitignore files instead, which are placed in the file directory for re-inclusion [ here ]. Depending on the taste, this may be a more beautiful solution.
tanius
source share