How do I destroy commits?

Rationale: getting rid of a commit that contains credentials that were mistakenly committed.

Force pushing the branch does not purge the unreferenced commit (which is perfectly reasonable behavior, and it’s still referenced elsewhere like the activity graph).

However, ./bin/remove destroy rEXAMPLEbadf00d does not work:

Usage Exception: Object "rEXAMPLEbadf00d" can not be destroyed (it does not implement PhabricatorDestructibleInterface).

Assuming this is a Git repository:

Once the commit is unreachable (you’ve force-pushed over all refs which it is an ancestor of), manually purge the commit from the repository by running git prune --expire=now from the CLI, then purge Phabricator’s caches with ./bin/cache purge --all. Phabricator does not store commit content outside of caches.

If you’ve committed sensitive information to a field Phabricator does store (like you’ve authored a commit as My Password is hunter2 <this.is.my@password.com>, or a password or API key appears in a commit message) your only option is to manually edit the information in the database using raw MySQL commands.

That worked perfectly, thank you!