Dotfiles history
mise saves versions of the files you track in a local Git repository, so you can compare them, restore an earlier version, and undo a change. History stays on your machine until you sync it across machines.
Start with Track files, or follow Set up a machine for the whole flow on two machines. To get back an earlier version of a file that is already tracked, go to Compare versions and Roll back. The dotfiles reference lists the [history] table and the history settings.
Requirements
History needs git on PATH (on macOS, the Xcode Command Line Tools). Without it, mise dot save fails, bootstrap commands still run and record their operations without file contents, and mise dot status says why.
History is on by default (history.enabled) but records nothing until something is tracked: by mise dot track, by a [dotfiles] entry with mode = "track" in your global or system config (however that file got there), or by an adopted setup repository. Setting history.enabled to false stops automatic and explicit saves. You can still browse history and edit checkpoint descriptions, and existing history is kept.
Parallel jobs that share one MISE_STATE_DIR, such as CI jobs, can wait on each other's history lock. Give each job its own MISE_STATE_DIR, or set MISE_HISTORY_ENABLED=false, if they should never interact.
Track files
mise dot track ~/.zshrcmise dot track saves the path's current contents as a checkpoint and adds a tracking entry to your global config. You can also write the entries yourself, one for each file or directory you want to save:
[dotfiles]
"~/.zshrc" = { mode = "track" }
"~/templates" = { mode = "track" }
"~/.gitconfig" = { mode = "template", source = "~/templates/gitconfig.tera" }History saves ~/.zshrc and the files in ~/templates. The template creates ~/.gitconfig; track that output separately if you want its history too. mise reads tracking entries only from system and global config. It warns about and ignores mode = "track" in a project config.
Track exact paths under your home directory or your mise config directory. Tracking entries name paths, not globs. A tracked directory includes files added beneath it later, subject to the selection and exclusion rules. To share tools, services, and templates, track your mise config and the sources it uses as well; bootstrap reports required files that are missing from history.
A symlink is saved as a link; track its target separately to save the target's contents. Checkpoint contents covers symlinked parent directories.
A tracking entry cannot contain keys that deploy a file, such as source, content, or permissions; the modes and keys table lists the keys it accepts. mise dot paths reports an entry with other keys as invalid and leaves it out of history, and mise dot track exits non-zero if the entry it writes is not active.
Start with individual configuration files, so that you choose what to save. Leave logs, caches, databases, and application session state out of history.
Preview before tracking
Tracking a directory saves everything under it, so preview a large one first:
mise dot track --dry-run ~/.codex
# ~/.codex: 22,972 files, 1.2 GiBmise dot paths --preview ~/.codex shows the same count and size and also lists the files. Both commands show what would be left out, including credential files and nested repositories, and neither writes anything. They read file metadata, not contents, and skip unreachable subdirectories, so a preview can show a selected-file count without a total for the whole directory.
mise dot track prints the same count and size before it saves, and warns when a tree is larger than 5,000 files or 256 MiB. The warning does not stop tracking, and a scan that reaches its limit is reported as incomplete. Trim the tree with an exclusion before you track it, for example mise dot exclude '~/.codex/sessions/**'.
Save a checkpoint
A checkpoint is a saved version of your tracked files, stored as a Git commit. To save the current contents of one file:
mise dot save ~/.zshrcTo save all tracked files with a description:
mise dot save --description "before changing my theme"A save that finds no changes creates no commit. With --description, --label, --task, or a --trigger other than save, mise dot save creates a checkpoint even when the files have not changed.
save fails if it cannot save anything, for example because Git is missing, history is disabled, or the requested path is not tracked. --best-effort turns a failure to write the checkpoint, such as missing Git, into a warning for scripts that should continue; a disabled history or an untracked path still fails.
Commands that change tracked files, such as mise bootstrap, mise dot apply, and mise dot rollback, save their own checkpoints before and after their work; see operation checkpoints.
Save automatically
The watcher is a background service that saves changes to tracked files, including edits made by your editor, an application, or another command. Add it to your global config:
[bootstrap.services.mise-history]
builtin = "history-watch"Install it and check that it is running:
mise bootstrap services apply
mise dot statusmise installs the watcher as a user service, without root: a systemd user unit on Linux, a LaunchAgent on macOS, or a Scheduled Task on Windows. A full mise bootstrap does the same. See user services if it fails to start. Without a service, mise dot watch runs the watcher in the foreground, and mise dot watch --once runs one scan, for example from a timer or cron job.
The watcher saves an ordinary edit once the file has been quiet for history.watch.debounce. A file that keeps changing is saved less often, so it can have unsaved edits while other files are already saved; mise dot paths --noisy lists those files. Files changed together, such as several files one command rewrote, are saved in one checkpoint. While the newest checkpoint is an automatic save that has not been synced yet and is less than five minutes old, another save of only the files it changed replaces it, so a run of edits to one file leaves one checkpoint. Explicit save commands still save immediately. The watcher reference describes the schedule.
Save some files only on request
A file that never belongs in history is excluded. For a configuration file you want to save only when you ask, turn off automatic saves when you track it:
mise dot track ~/.config/app/state.json --no-autosave
mise dot save ~/.config/app/state.jsonThis writes autosave = false on the entry. Tracking saves the first version immediately, and later edits wait for mise dot save <path>. The watcher's checkpoints keep the file's last saved version. Commands that change or capture the file, such as mise bootstrap and mise dot capture, still save it before they run.
Check watcher health
If files are not being saved or shared, start with:
mise doctor
mise dot statusmise doctor reports a watcher that is declared but stopped, repeated save failures, an unusable history store, and files saved less often because they change constantly. It includes the command to start a stopped watcher.
mise dot status gives more detail: whether the watcher is running, declared but stopped, or not declared (shown as manual: edits are saved when you run mise dot save), and whether its saves are failing; the latest save and full scan; the last failure; and each busy file's save interval, last save, and pending edits. It also lists tracked files that changed since the latest checkpoint, which mise dot save would record:
⚠ unsaved changes: 2 path(s) since the latest checkpoint (~/.config/app/added.toml, ~/.zshrc); `mise dot history diff` shows themThe line names up to five paths. Finding them reads every tracked file, like mise dot history diff.
Both commands also report a watcher service that runs an outdated mise, or that watches another store because it uses a different MISE_STATE_DIR. Run mise bootstrap services apply to restart it.
These commands read the watcher's saved health report without starting a sync or changing files. Old reports are marked stale after a few full-scan intervals. A busy file's longer save interval is informational. For desktop notifications about sync conflicts, see Conflict notifications.
Describe automatic checkpoints
history.describe_command runs a command, such as a coding agent, to describe each checkpoint the watcher saves. Set it in your global or system config; mise ignores it in project config. For example, with Claude Code installed:
[settings.history]
describe_command = "claude -p --output-format text --no-session-persistence 'Describe this change to my configuration files in one line of at most 120 characters, plain text, no quotes.'"This sends change details, including the diffs of unencrypted files, to the command you configure. Excluded files are not named, and the contents of files encrypted in either checkpoint are not sent.
The command reads the change as JSON on stdin and prints a one-line description. The description command reference has the payload, its limits, and what happens when the command fails.
To describe any checkpoint by hand, run mise dot history describe <ref> <text>.
Compare versions
List the checkpoints where a file changed, newest first:
mise dot history --path ~/.zshrc2 2026-10-07 18:12 save edited ~/.zshrc 1
1 2026-10-07 18:12 baseline tracked ~/.zshrc 1Each line shows the checkpoint ID, when it was saved, what triggered it, its description, and how many files it changed. Without --path, mise dot history lists recent checkpoints for all files: 20 by default, and every one with --limit 0. --trigger and --label filter the list.
Use an ID from the list to inspect one checkpoint. The examples below use checkpoint 12:
mise dot history show 12
mise dot history diff 12 --patch --path ~/.zshrchistory show displays what triggered the checkpoint and which files changed. Add --files to list every file in it, or --json for structured output. history diff 12 shows what changed in that checkpoint. To compare two checkpoints, give both IDs:
mise dot history diff 11 12 --patch --path ~/.zshrcTo compare your current file with its latest saved version:
mise dot history diff --path ~/.zshrcThis also shows unsaved edits in files with autosave = false. Add --exit-code to make a difference return exit status 1, or omit --path to compare all tracked files.
Refer to a checkpoint
Use a checkpoint ID from history, or one of these references:
| Reference | Meaning |
|---|---|
12 | Checkpoint with local ID 12 |
latest | Most recent checkpoint |
latest~1 | Checkpoint before the most recent one; use ~N to go farther back |
commit:<sha> | Git commit identified by a full hash or an unambiguous prefix |
With --path, latest~N counts only checkpoints where that path changed:
mise dot history show latest~1 --path ~/.zshrcThis selects the checkpoint before the file's most recent change, even if other files have changed since then.
Numeric IDs are local, and they can change if mise rebuilds its index. Use a Git commit hash when you need a stable reference. A plain number always selects a checkpoint ID; a commit prefix that is not all digits also works without commit:.
Roll back
To restore a file to its most recent saved version that differs from its current contents, preview the change and then apply it:
mise dot rollback ~/.zshrc --dry-run
mise dot rollback ~/.zshrcmise saves the current contents before replacing them. To reverse that rollback, run:
mise dot undomise dot undo restores the tracked files that the newest operation changed, and other files keep their current contents. Both rollback and undo create new commits, so earlier versions stay available and the restored version can sync to other machines.
Each rollback or undo records two checkpoints: one that holds the state before it and one with the result. Its message names both, and names the version it restored by the checkpoint that saved it:
history: rolled back ~/.zshrc to checkpoint 6; recorded as checkpoint 10, with checkpoint 9 holding the state before itmise dot history --path ~/.zshrc lists only the checkpoints that changed the file, so it shows 6 and 10 but not 9 unless you had unsaved edits.
To choose a checkpoint, use an ID from history or a checkpoint reference:
mise dot rollback ~/.zshrc --to 42
mise dot rollback --to latest~3 --all --dry-run--all selects everything the chosen checkpoint covers. If that checkpoint recorded a file as absent, rollback deletes the file. This can also happen without --to: an earlier saved state where the file was absent counts as a version to restore.
The preview reports each path as:
| Action | Meaning |
|---|---|
write | Replace the file with different saved contents |
delete | Remove a file recorded as absent |
remove if empty | Remove a directory this rollback emptied, if nothing else remains in it |
unchanged | Keep a file that already matches |
skip | Leave a path the checkpoint did not cover or omitted |
conflict | Resolve a changed path type, such as a file becoming a directory; replacement needs --force |
Git does not record empty directories, so rolling back a directory leaves empty folders it has no record of alone. Restoring configuration files leaves installed packages and running services as they are; run mise bootstrap to apply the restored configuration.
Rollback, undo, and pull write files one at a time and journal each one. If one is interrupted, run mise dot recover to finish it; see Recovery.
Reload an application after restoring files
Add commands to your global config to reload an application after its files change:
[history.reload]
"~/.config/hypr/**" = "hyprctl reload"Each matching command runs once, after rollback, undo, or pull has written the files. mise reads these commands from your system and global config before the operation starts.
The same commands run when mise dot apply or the dotfiles step of mise bootstrap writes a matching path: a link or copy it creates, a template it renders, or an edit it applies. Nothing reloads on a dry run, on a bootstrap that skips dotfiles, or on mise dot sync, which never writes live files. A glob also matches paths inside a symlinked directory: "~/.config/hypr/**" fires for a "~/.config/hypr" = "dotfiles/hypr" entry.
Reload commands react to file changes; they are not a place for machine setup. Because mise reads them before the restore, commands that arrive in the same update, including the first mise bootstrap --adopt, do not run for it. Put setup steps such as installing shell plugins or fixing permissions in the bootstrap task, which runs on adoption and on each mise bootstrap after a shared update.
Capture an external command
To see what an update did to your tracked files, wrap it with mise dot capture. For example, on Omarchy:
mise dot capture --label "omarchy update" -- omarchy-update
mise dot history --label "omarchy update"
mise dot history diff --operation --patchcapture saves your tracked files before and after the command, including files with autosave = false. It records the label and whether the command succeeded. The diff compares those two checkpoints, even if other saves happened later. To inspect an older operation, give its checkpoint ID:
mise dot history diff 42 --operation --patchThe command runs directly, with inherited input, output, and environment. Use -- sh -c '...' when you need shell syntax. If capturing fails, mise warns and the command still runs with its own exit status. Failed commands, and commands that change nothing, still keep their checkpoint pair.
Other history writers wait until the pair is complete. Editors and other programs can still change files during that time, and their edits appear in the comparison too. undo restores tracked-file changes across the whole interval. To restore only some files, find the operation's Before checkpoint with history show, then run mise dot rollback <path> --to <before-ref>. Packages, service state, and untracked files are outside this recovery. Operation checkpoints covers a capture that is killed before it finishes.
Stop tracking a file
mise dot untrack ~/.zshrcmise dot untrack removes the tracking entry. The file stays in place. Future checkpoints leave it out, but its earlier versions remain in Git and can still be shared. To erase the earlier versions, see Erase a file from history. To keep a file's history without ever sharing it, track it with mode = "track-local" instead.
For an entry inherited from another config file, such as system config, untrack sets enabled = false in your config.local.toml instead. You can turn off any inherited entry the same way, with enabled = false in a later config file.
A path inside a tracked directory has no entry of its own, so untrack adds a rule for it to the global [history] exclude list, and mise dot include <path> removes that rule. For patterns, such as a directory's logs or caches, exclude them instead.
Undo an accidental track
track saves immediately, so a secret tracked by mistake is already in a checkpoint, and untracking it leaves that checkpoint in place. Rotate the credential, then erase the file from history. To avoid the mistake, preview a directory first with mise dot track --dry-run <path>.
Erase a file from history
untrack, rollback, and undo only add checkpoints, so a secret you tracked by mistake stays readable in the earlier ones. To erase it, rotate the secret and stop tracking the file, then run mise dot history purge:
mise dot untrack ~/.aws/credentials
mise dot history purge ~/.aws/credentialsIt lists the checkpoints that hold the file and asks before it rewrites anything (--dry-run stops after the list, --yes skips the question). A checkpoint that changed only that file is removed. Every other checkpoint stays, without the file, and keeps its description, date, label, and number, so mise dot history, rollback, and undo keep working. Afterwards mise deletes the replaced objects from its repository. Pass --keep-objects to leave them, or --backup to keep the old history under refs/mise/purge-backup/, which still holds the secret.
Stop the watcher first, so it does not save the file again while the command runs. If the file is still tracked, the next save records its current contents.
mise never rewrites history that is on the origin, so the command refuses if any saved version of the path was synced. Remove it from the origin with Git, as in Remove plaintext from history, and re-adopt the history on your other machines. Purging removes mise's own copies only: a backup, a clone of the repository, or a synced origin keeps its own.
A file tracked with mode = "track-local" has a separate history: after untracking it, purge it with mise dot --local history purge.
Select and exclude files
A tracked directory saves every file beneath it unless you narrow it. An include list names the files to save, exclusions leave files out, and mise leaves some files out on its own.
Select files in a directory
Use include when a directory holds a few configuration files among many caches, logs, or session files:
[dotfiles]
"~/.codex" = { mode = "track", include = ["config.toml", "rules/**"] }This saves config.toml and the files under rules/. New files elsewhere in ~/.codex stay out of history without another exclusion.
| Configuration | Selection |
|---|---|
No include field | The directory's files, with built-in credential filtering |
include = [] | No files |
A populated include list | Files matching any pattern, including credential-named files |
| An explicit exclusion | Removes matching files from any of the above selections |
Include patterns are relative to the tracked directory and follow the pattern syntax; in an include list, * never crosses /. Literal names and globs have the same authority: include = ["**"] also selects credential-named files. Encryption is a separate choice; encrypt = true encrypts the selected files.
Credential files selected by name are saved in plaintext
Without encrypt = true, credential-named files that an include list selects are saved in plaintext and can be shared with your origin. Previews and path listings label them plaintext:, and saves produce capture warnings, which do not stop a save. Adding encryption later does not remove plaintext from earlier commits.
For example, to save a shell function whose name triggers the credential filter:
[dotfiles]
"~/.config/fish" = { mode = "track", include = ["functions/secrets.fish"] }That entry selects only this file. To save real credentials, encrypt them:
[dotfiles]
"~/.aws" = { mode = "track", include = ["credentials"], encrypt = true }Configure encryption recipients first. Changing include does not turn off encryption or rewrite existing history. If you remove encryption and save plaintext at a path that was encrypted before, the publication check still covers that path throughout the history.
Include lists apply only to tracked directories. For a single file, track it directly, or track its parent and select the file by relative path. Invalid include or exclude globs make a tracked entry invalid; fix the entry before you track it again. Include lists are shared with your other machines and recorded in checkpoints, so rollback knows which files were outside them; see mixed mise versions.
mise dot include edits a different list
mise dot include <glob> removes a rule from the global [history] exclude list. It does not change a directory's include field; edit the [dotfiles] entry for that.
Exclude files from one directory
Put an exclude list on a tracked entry to leave out files beneath that path without affecting other entries:
[dotfiles]
"~/.codex" = { mode = "track", exclude = ["sessions", "*.log"] }Patterns are relative to the tracked directory and follow the pattern syntax. sessions excludes every directory with that name, at any depth, with its contents; *.log excludes matching files at any depth; and /cache excludes only ~/.codex/cache.
The entry's list and the global [history] exclude list both apply, and a global !glob cannot bring back a file the entry excludes. mise dot paths and mise dot track --dry-run show the lists in effect.
To check a directory file by file, run mise dot files. It marks each file as tracked, excluded (naming the rule), omitted, or untracked:
mise dot files ~/.codex
mise dot files -r --untracked ~/.config/nvimExclude files across tracked entries
mise dot exclude adds a glob to [history] exclude in your global config. Quote it so that your shell does not expand it:
mise dot exclude '~/.codex/sessions/**'
mise dot pathsAn absolute pattern applies only to that location, so this example leaves ~/.config/kitty/sessions/ alone. A relative pattern, such as cache, matches beneath every tracked entry. To remove the rule, pass the same glob to mise dot include:
mise dot include '~/.codex/sessions/**'A later !glob in [history] exclude brings back a path that an earlier rule excluded. Removing one rule does not override other rules that still exclude the path. The pattern syntax reference covers matching order, absolute patterns, and invalid rules. After you fix a rule that mise warned about, check the result with mise dot paths.
Files left out automatically
History leaves some files out without an exclusion:
- Files whose names look like credentials, such as
id_ed25519,*.pem, and*token*, unless they are encrypted or an include list selects them. To save one that is safe in plaintext, track it directly withmise dot track --allow-plaintext <file>. See the credential filter. - A directory with its own
.gitinside a tracked directory. To save its working files, track its root as its own entry. See nested repositories. - Files ending in
.local.toml, which are machine-local config and are never saved, even withencrypt = true. - Files that mise cannot save, such as oversized or unreadable ones. See checkpoint contents.
Different contents on different machines
A variant lets a tracked file have different contents on different machines, at the same path on each one. For example, to keep separate versions of ~/.zshrc for macOS and Linux:
[dotfiles]
"~/.zshrc" = { mode = "track", variants = [{ os = "macos" }, { os = "linux" }] }Add this to your global config, or run mise dot track ~/.zshrc --os macos to add one variant. os takes an optional architecture after a /, so os = "macos/arm64" matches only Apple silicon Macs (platform config file names write the same thing as macos-arm64). os = "unix" shares one version between Linux and macOS and skips the path on Windows:
[dotfiles]
"~/.zshrc" = { mode = "track", variants = [{ os = "unix" }] }Use profile to select a config environment:
[dotfiles]
"~/.gitconfig-work" = { mode = "track", variants = [{ profile = "work" }, { default = true }] }When several variants match, the most specific one wins, and a tie makes mise report the ambiguity and skip the path until you fix it. When nothing matches, mise uses the variant marked default = true; without one, it skips the path on that machine.
When a variant becomes selected on a machine, for example when you activate a profile with -E work after another machine saved that profile's version, the saved version is the other machine's. Until mise dot pull applies it, saves leave that path alone, and mise dot status lists it as not applied here. A pull writes the saved version when the file is missing here or unchanged since this machine last had the variant selected. When this machine has a different copy, the pull stops with a conflict: mise dot pull --take-remote <path> takes the saved version, and mise dot pull --keep-local <path> followed by mise dot save <path> keeps yours. --keep-local works only on a tracked file; inside a tracked directory, take the saved version, then copy yours back and save it.
--take-remote cannot be undone here
Your copy was never saved on this machine, so mise dot undo cannot restore it after --take-remote replaces it. Copy the file aside first if you might want it back.
The variant selectors reference has the scoring rules and what a skipped path means. Tracked variants do not accept target; to deploy a file to a different path on each machine, see Different targets on different machines.
One version per machine
Some files describe the machine itself, such as a monitor layout or a trackpad setting. Give every machine its own version with a machine variant:
[dotfiles]
"~/.config/hypr/monitors.lua" = { mode = "track", variants = [{ machine = true }] }Or run mise dot track ~/.config/hypr/monitors.lua --machine.
Each machine saves, rolls back, and restores its own version. Sync shares the other tracked files as usual, but never applies one machine's version on another. Each version is still pushed to the origin with the rest of the history, so it is kept off the machine and can be restored on it later.
The stream is named after the machine, for example machine-omarchy-3f2a9c1b: its hostname and a random suffix, chosen the first time and kept in $MISE_STATE_DIR/history/machine. Renaming the host does not change it, and two machines with the same hostname still get separate versions. To choose the name yourself, set it in the machine's global config, for example in ~/.config/mise/config.local.toml:
[history]
machine = "desk"After reinstalling a machine, set its earlier name to continue that machine's history. A machine variant must be the entry's only variant and cannot be combined with encrypt. Upgrade every machine that shares the setup before you use it; see mixed mise versions.
Local-only history
Some files are worth keeping a history of but should never leave this machine: application state, a work-only configuration, a credential you want to roll back. Track them with mode = "track-local":
[dotfiles]
"~/.config/app/state.json" = { mode = "track-local" }Or run mise dot track --local ~/.config/app/state.json.
Their versions are saved in this machine's own history, under $MISE_STATE_DIR/history-local, which no origin ever reaches: neither their contents nor their enrollment metadata enter shared history or a push. A declaration written in a separately shared config file is still shared as part of that file's text. Local files are saved, browsed, and restored like any tracked file:
mise dot save # saves both histories
mise dot history --path ~/.config/app/state.json
mise dot rollback ~/.config/app/state.json
mise dot --local history # list the local-only checkpoints
mise dot --local undo # undo the latest local-only rollbackCommands that name a path go to the history that keeps it; one command cannot name paths of both. mise dot --local selects the local-only history for commands without a path. mise dot capture saves a labeled checkpoint there before and after the command, and the history watcher watches both.
A local-only path may lie inside a tracked directory, such as ~/.config/app/state.json inside a shared ~/.config/app: the shared history then leaves that file out. Versions already saved in the shared history before the path became local stay there, as with untracking. If another machine shares the same path, this machine neither applies its versions nor publishes its own. Everything inside a local-only directory is local-only too: a shared declaration of a path in it is refused.
track-local takes no encrypt or variants, since its history never leaves the machine. Credential-named files are still left out unless the entry sets allow_plaintext = true.
Track files that mise also deploys
You can save the history of a file that mise copies, links, renders, or edits. For example, tracking ~/.zshrc also saves the changes that a managed block or shell activation writes into it.
When you track a file that a [dotfiles] entry already manages, mise keeps that entry and writes the tracking entry to ~/.config/mise/conf.d/dotfiles-tracking.toml. Untracking removes only the tracking entry. A tracked directory can also contain managed files or template sources, and their copy, link, or template entries keep applying. Entries that would create the same target are still rejected.
See also
- Dotfiles reference covers what a checkpoint records and leaves out, recovery, the history lock, and the watcher's schedule.
- Sync across machines shares your history through a private Git repository.
- Encrypted files saves credentials without storing them in plaintext.