Using git version 2.34.0.windows.1
I have a /.gitignore
file at the root of my repository with the usual suspects of extension ignores in it (it's not really relevant here).
Halfway up the tree (/a/b/c/.gitignore
), I have another file, where I wanted to say "recursively below this directory, ignore any directory called devl
, except for one particular file extension directly inside". So I put the following rules:
devl/**
!devl/*.dat
Unfortunately, it appears this does not work -- git still reports the file /a/b/c/d/devl/test/foo.bar
as untracked, not ignored. (It does not ignore anything at all in the devl
directory tree.)
I was able to work around this by using the following rules instead, but as far as I can tell from the documentation, the above should have been legal and working as well:
/**/devl/**
!/**/devl/*.dat
Why is this? Is it a bug or a misunderstanding?