.gitignore does not include stuff from directories
The current .gitignore has the allowlist items of the form !/dir/*
. The gitignore manpage however says
An optional prefix "!" which negates the pattern [...] It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.
So instead, the pattern should simply be !/dir/
.
I attached a diff which should work on the current HEAD.