A tool to remove API keys within a github repo by overwriting history. Requires everybody who’s cloned to repo to re-clone, so that they don’t keep the old history.
Usage
git clone https://github.com/newren/git-filter-repo.git
./git-filter-repo --sensitive-data-removal --invert-paths --path src/google-services.json --force
- Check affected branches
grep -c '^refs/pull/.*/head$' .git/filter-repo/changed-refs
- If there is no affected branches, then push these changes
git push --force --mirror origin