Nov. 30, 2025
What I Learned Sensitive information (API keys, private keys, configuration files, etc.) that has been accidentally committed continues to remain in Git’s history even with normal deletion. By using git filter-repo, you can rewrite Git history and completely remove sensitive information. However, removing from history does not make already leaked credentials safe, so you must always revoke and reissue the relevant credentials.
Details Background Previously, methods using git filter-branch were introduced, but warnings are now issued in the official documentation, and when creating new procedures, the use of git filter-repo is recommended.