Sanitising an existing git repository before publishing

I wanted to publish my Doom Emacs (opens in a new tab) configuration. I have been making some things that I am not ready, or maybe even willing, to publish as a package. I do want to make them accessible to others. I use Emacs mostly for taking notes and editing blog posts. Increasingly also for working with code and large language models.

I used a language model and harness, and asked if there were any things unfit to publish. It found an API key (which is local, but still), some e-mail addresses and endpoints.

I also asked it to check the README for things that were out of date.

What I did not ask was to go through the git history. I should have. The history also contained some private data.

I don’t normally re-write git history, so it is great to get some help with it. One of the steps I did not expect was to create a fresh clone, so more could be re-written. The model suggested that some items could rem in on the remote, so it was better to start fresh. That was a useful nudge, as it was still hosted by a cloud provider, instead of my own git server.

It also rewrote history in some branches I had lying around and forgot about:

 The history cleanup is complete in /Users/willem/doom-config-public.

 - Rewrote history across main, unified, and empty-doom, preserving their branch histories while removing the embedded MTPLX value, AWS
   identifiers, and your email addresses from tracked content and commit metadata. The cleanup commit is now 1e08cff; its commit message is
   docs: sanitize public config and refresh README.
 - Verified all Git objects, including unreachable objects: no matches for the removed values. No stale refs, remotes, or reflog entries remain.
   git-filter-repo removed the old origin; nothing was pushed.
 - The original /Users/willem/.doom.d checkout remains unchanged. The Journelly example and both licenses were verified unchanged.
 - All 31 ERT tests passed. README local links and git diff --check passed. config.el has a check-parens failure that is also present in its
   pre-cleanup version; the other checked Elisp files passed. PDF export tools were not available to verify here.
 - clean-git.md remains untracked and uncommitted as instructed. The locally installed .venv is ignored.

This is the kind of busy work that I otherwise would not do, and my doom configuration would remain unpublished.

It is now live on my git server (opens in a new tab). Enjoy!