I deployed an app in Heroku using Github, and the code works fine.
I have a piece of code which creates uploads
directory in the root and puts in all uploaded files. I was able to retrieve the files without any trouble after uploading. However after an hour or so (perhaps after the dyno sleeps and restarts) the files were all gone.
A file (with a random file name) which was cached in git sneaked into the repository (although I have gitignored the directory) and not until I found the same exact file (with that exact name) on heroku server, I understood the problem is not that files are being deleted, but rather it's being synced with my repository that's causing the problem.
How do I prevent this from happening?
PS: I made sure Automatic deployment is off in heroku and checked again. Same results. Google doesn't give any relevant results for "files lost heroku" or "prevent automatic sync heroku github" ://