Simply check which exact .gitignore and which exact rule is ignoring public:
cd /path/to/my/repo
# from the root folder of the repo:
git check-ignore -v /storage/app/public/aFileWithinPublic
You need to test a file, since a folder is not tracked by Git.
The rule is simple:
It is not possible to re-include a file if a parent directory of that file is excluded.
So if the folder public is ignored (by a '*' rule in a parent .gitignore) of if any of the parent folder of public is ignored, no amount of exclusion will be able to make public content not-ignored.
So this is good (from the .gitignore
in storage/app/
, parent of public/
folder):
*
!public/
But if storage/app/
or storage/
are ignored themselves, this exclusion would be ignored as well.
That is why git check-ignore -v /storage/app/public/aFileWithinPublic
is important: it will explain what causes the folder content to still be ignored.