gitgithooksgit-post-receive

I edited gitignore to allow my images storage folder to upload, but when I push nothing is updated


I recently setup post-receive hooks on my digital ocean droplet and connected it with my laravel local project. Everything works great except my public/storage/images don't get uploaded with each commit. I tried to edit my local .gitignore file so it doesnt include the public/storage folder but nothing is being uploaded when I commit. Here is my current .gitignore file contents

/node_modules
/public/hot
/storage/framework/*.key
/storage/logs/*.key
/vendor
/.idea
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
.phpunit.result.cache

I changed the /public/storage and /storage/*.key

Thanks Chris


Solution

  • but nothing is being uploaded when I commit.

    Check if another rule is ignoring your folder:

    git check-ignore -v -- /path/to/a/file/to/add
    

    If the folder or any parent folder is ignored, you should whitelist it, then whitelist the content:

    !public/
    !public/storage/
    !public/storage/images/
    !public/storage/images/*