Let's say I have ignored a directory, but I want to unignore specific subdirectories therein. So I have the setup:
/uploads/
/uploads/rubbish/
/uploads/rubbish/stuff/KEEP_ME/
/uploads/foo/
/uploads/foo/bar/lose/
And I want to ignore everything but the KEEP_ME
directory. I would hope the ignore would look something like:
/uploads/*
!/uploads/rubbish/stuff/KEEP_ME/
But that's not working, and neither are several permutations on the same theme.
One that does work is
/uploads/**/**/**/
!/uploads/rubbish/stuff/KEEP_ME/
But that feels a little restrictive and verbose?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…