Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DavidSprauel's avatar

[L 5.6] gitignore in storage folder

Hi,

I have certain files on my storage/app/public folder, everything must be ignored by git except one folder.

I've tried many way in the git ignore and none seems to works except removing the *.

Here is the storage/app/public/.gitignore (upper level .gitignore causes no problem)

*
!.gitignore
!files/

here is my git status --ignored

.idea/
.phpstorm.meta.php
_ide_helper.php
bootstrap/cache/packages.php
bootstrap/cache/services.php
composer.lock
node_modules/
package-lock.json
storage/app/public/csv/
storage/app/public/files/
storage/app/public/tiles/
storage/logs/laravel.log
vendor/

Am i missing something ?

0 likes
1 reply
lostdreamer_nl's avatar

Could you try:

*
!.gitignore
!/files

inside storage/app/public/.gitignore

Please or to participate in this conversation.