mise dotfiles history purge
- Usage:
mise dotfiles history purge [FLAGS] <PATH>… - Effect: destructive — may delete or irreversibly overwrite
- Source code:
src/cli/dotfiles/history/purge.rs
Erase a path's saved versions from history
Rewrites the history without the path, for a file you tracked by mistake that holds a secret. untrack, rollback, and undo only add checkpoints; they leave the old versions readable.
Checkpoints that changed only this path are removed. The others stay, with their descriptions, dates, and IDs, minus the path. Without --yes, the command lists what would change and asks first.
mise never rewrites history that is on the origin: if a saved version of the path was ever published, the command refuses. Rotate the secret, then see https://mise.jdx.dev/dotfiles/encryption.html#remove-plaintext-from-history.
This does not stop tracking the path. If the file is still tracked, the next save records its current contents again, so run mise dot untrack first (or encrypt it). Stop the watcher service while this runs.
Arguments
<PATH>…— Files or directories to erase from history
Flags
-n --dry-run— Show what would change without changing anything-y --yes— Rewrite without prompting--backup— Keep the replaced history in the repository underrefs/mise/purge-backup/The backup still holds the content you are erasing; delete it with
git update-ref -donce you are sure.--keep-objects— Leave the replaced objects on disk instead of deleting them-h --help— Print help
Examples
List the checkpoints that hold the file
mise dot history purge ~/.aws/credentials --dry-runErase every saved version of the file
mise dot history purge ~/.aws/credentials --yes