Loading tutorials
git filter-repo. Before you run it, you need a clear picture of what "rewrite" means. Git never edits an old commit. The tool buil5 min readgit filter-repo and preparing the working copy it will rewrite. The setup takes only a few commands, but it decides whether the later rewrite is safe and repeatable.7 min readgit-filter-repo installed, and permission to force-push to the repository. Rewriting history does not make a leaked secret safe, because anyone who already fetched it still5 min readgit filter-repo --replace-text. It assumes you have already rotated the leaked credential, found the commits that contain it (previous chapters), and are working in a fresh clone. You should be comfortable with basic Git commands and with the idea t6 min read--replace-text and on verification. You should already be comfortable with an expressions file, a fresh clone, and the git log -S search. Here you extend the same workflow to text that --replace-text never touches: the messages attached to com5 min readgit filter-repo in a fresh clone, using --invert-paths, --replace-text, or both. It also assumes you know basic git log and git grep. Verification comes after the rewrite and before the force-push. A push publishes the re6 min readgit filter-repo in a fresh clone, and verified that the secret no longer appears in any ref. It also assumes you have permission 6 min readgit filter-repo, verified the result, and force-pushed. You should be comfortable with Git remotes and refs and know that commits are identified by hashes. The rewrite fixed your repository. It did not fix 7 min readgit filter-repo, verified the result, and force-pushed it. It also assumes you know git fetch, git rebase, and git cherry-pick. The rewrite is not finished until everyone who cloned the repository has5 min read