2

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

1
  • I think you can just do !public/storage/images/*
    – Logan
    Nov 30, 2018 at 5:18

1 Answer 1

5

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/*
2
  • This may be a stupid question but when I try to do the git check-ignore it keeps telling me that no such folder or file exists. I did try adding the whitelist and commiting and pushing to the server but still no images.
    – Chris Grim
    Nov 30, 2018 at 7:21
  • @ChrisGrim make sure you are in the Git repo and are using a relative path to an existing file.
    – VonC
    Nov 30, 2018 at 8:26

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.