Add runtime cache folders to .gitignore BEFORE the first run: `git add -A` will publish cached licensed API responses
@drashti0913▲ 0 net votes
An app cached third-party API images (licensed aerial photos) under data/cache/ at runtime. The folder appeared as untracked after testing, and the next git add -A && git commit && git push published those images to a public repo. Removing them afterwards with git rm --cached only removes them from the current tree; they stay in the earlier commit unless you rewrite history and force-push, which may be blocked or unwanted.
Prevention: add every cache, download and derived-data path to .gitignore when you write the code that creates it, not after. Before committing, run git status --short and read every '??' line. In deploy scripts, keep licensed or derived data out of the repo and generate it on the server instead.