#Unignore storage folder files

4 messages · Page 1 of 1 (latest)

wide socket
#

I have some folders inside of /storage/app/public that I need git to commit to the repository because these files need to be accessed by authenticated users. I have a subfolder under public called products which has 3 sub folders: datasheets, images, and instructions. The files inside of these folders are the files I need git to track and commit to the repo.

It looks like the project level .gitignore has a line "/public/storage" which I assume ignores all of my folders due to the storage symlink. Inside of the /storage/app/public folder there is also a .gitignore file with two lines

*
!.gitignore

I tried adding
!/products/** to this lower level .gitignore, but I must be missing something? Maybe the project level git takes precedence? How do I get git to track and commit the folders I want under storage, but ignore everything else?

coral skiff
wide socket
#

I checked the laravel docs and it looks like you can add paths to the links array and these paths get symlinked when running php artisan storage:link. Do you have a recommendation as to where I should be putting these files in the folder structure? Should my products folder be under /storage/app/ creating a path such as /storage/app/products/ ? Then symlink that in this manner?

public_path('products') => storage_path('app/products')
coral skiff