I have the following directory structure:
/app
/src
/MyProject
/FirstProject
/Controller
/file-1-1.php
This .gitignore
will actually work:
/app
/vendor
/web
/src/**/**
!src/**/
!/src/MyProject/SecondProject/Resources/**
mipadi's answer refers to a mechanism introduced in git 2.7.0 and... reversed in 2.7.1!
The only rule left is:
It is not possible to re-include a file if a parent directory of that file is excluded.
Hence the need for white-listing src
sub-folders, before white-listing Resources
content.
I tested the above with:
> git --version
git version 2.7.1.windows.1