I have a local folder /public/assets/images... that continues to be overwritten with the local copy once pushed to Digital Ocean. I have tried using varying paths in .gitignore all to no avail. It's gotten so out of hand it now looks like this:
node_modules
.svn
.env
**/.DS_Store
**/public/assets/images
*/public/assets/images
/public/assets/images
**/assets/images
*/assets/images
/assets/images
**/assets/images/news
*/assets/images/news
/assets/images/news
**/public/assets/images/news
*/public/assets/images/news
/public/assets/images/news
**/public/assets/images/profilePics
*/public/assets/images/profilePics
/public/assets/images/profilePics
**/assets/images/news
*/assets/images/news
**/assets/images/profilePics
*/assets/news
*public/assets/news/
**public/assets/news/
/public/assets/*
Strange that something on Git CLI goes smoothly and I'm bumping into this.
It's strange because even though the repo does not show updated, it in fact is each time I push. The contents of the folder go back to what I have local. Curiouser and curiouser.
Exactly. Locally, the directory has only two files. I run the webapp and set test users' profile pics to x.png. Everything is stable - until the next git push. Then the contents of the folder are reset to local. I have the user upload folder set in settings to this seems very odd. It started happening in the last week or so and I have been fussing with it, finally got frustrated enough to make a post.
I resolved the entire issue by saving images to S3; which is how it should have been done to start with. I was just trying to get something working thinking I'd switch later, but got stuck on the mystery that is this thread.
Anyways, problem solved in less than 30 minutes using S3 storage. It's more reliable, scalable, CDN feature - just better... and it leaves git out of it.