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
chmod +x ./git-filter-repo/git-filter-repo
./git-filter-repo/git-filter-repo --sensitive-data-removal --invert-paths --path src/google-services.json --force
  1. Check affected branches
grep -c '^refs/pull/.*/head$' .git/filter-repo/changed-refs
  1. If there is no affected branches, then push these changes
git push --force --mirror origin