Search code examples
gitgitignore

gitignore propagating exlusions to lower levels into directories


I have a in gitignore

*
!.*

and I would expect that I see all the subdirectories of .* but indeed git sees only the ones where the subdirectory starts again with .. For example, I see .java/.userPrerfs/.user.lock.., because both subdirectory start with ., but I do not see .conf/ario or .java/fonts/.

How does one limit the exclusion of * just to apply to the top level?


Solution

  • You want to include the path at the same level as your .gitignore file

    !./.*