use .gitignore to reverse selection,I just want to track the app catalog.App is the secondary directory under emply.
l used The following code,But git doesn't track anything
*
!*/
!*/app
I have already tested similar problems, Write like it, but invalid
I just had a slightly more tricky problem and ended up here, so if this is the case for you as well, here goes:
If you ignore a concrete directory (e.g. /Emply/ in this case) but want to include some of its sub-directories or included files, this will not work:
/Emply/
!/Emply/app # Does not work!
The reason is that git will not list ignored directories for performance reasons (source). Instead, use the wildcard to ignore all sibling directories and files:
/Emply/*
!/Emply/app # Works!
It's a bit obscure and just drove me mad.
Ignore everything, unignore top-level app and everything under it:
*
!/app/
!/app/*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With