{"record":{"id":"998f5d818afb2c6e","repo":"jdx/mise","slug":"run-mise-dot-save-path-first-keep-local-publishes-this","errorCode":null,"errorMessage":"run `mise dot save {path}` first: --keep-local publishes this machine's saved version of {path}, and it {reason}","messagePattern":"run `mise dot save (.+?)` first: --keep-local publishes this machine's saved version of (.+?), and it (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/apply.rs","lineNumber":255,"sourceCode":"                let reason = if saved.is_none() {\n                    \"has no saved version on this machine yet\"\n                } else {\n                    \"has unsaved changes\"\n                };\n                // The refusal stands either way, but as with an unusable live\n                // side a blanket choice holds just this path rather than\n                // discarding every decision it made alongside it. A path named\n                // on the command line is the user's own instruction, so it\n                // still fails the pass.\n                if blanket_chosen.contains(&local) {\n                    blanket_held.push(format!(\n                        \"{path} {reason}, so run `mise dot save {path}` first\",\n                        path = display_path(&local)\n                    ));\n                    keep_local.remove(&local);\n                    continue;\n                }\n                bail!(\n                    \"run `mise dot save {path}` first: --keep-local publishes this machine's saved version of {path}, and it {reason}\",\n                    path = display_path(&local)\n                );\n            }\n            let remote = match status.upstream_commit.as_deref() {\n                Some(head) => repo\n                    .object_at(head, &conflict.branch_path)?\n                    .map(|object| {\n                        if !encrypted.contains(&conflict.branch_path) {\n                            return Ok(object);\n                        }\n                        super::files::decrypt(\n                            repo,\n                            &conflict.branch_path,\n                            &object,\n                            !req.automatic && console::user_attended_stderr(),\n                        )\n                    })","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/sync/apply.rs#L237-L273","documentation":"`mise dot pull --keep-local <path>` resolves a sync conflict by publishing the version of the file that was previously *saved* on this machine. This error is thrown when the live file cannot serve that purpose: either the machine has no saved baseline for the path at all (freshly enrolled) or the file has unsaved edits since the last `mise dot save`. The command refuses rather than silently publishing a stale or nonexistent version.","triggerScenarios":"Running `mise dot pull --keep-local <path>` (explicitly or via a blanket keep-local choice) when the live object or mode differs from the saved baseline in the shared snapshot: (1) no saved version exists yet for the path, (2) the live file on disk differs from the saved baseline in content or permissions.","commonSituations":"A freshly enrolled machine trying to keep local before ever saving; editing a shared dotfile after the last `mise dot save` and then pulling with --keep-local; file permissions changed since the save.","solutions":["Run `mise dot save <path>` to record the current local content as the machine's baseline, then retry `mise dot pull --keep-local <path>`.","If the edits are unwanted, restore the file to its saved version or run `mise dot pull --take-remote <path>` instead of --keep-local.","Check `mise dot status` to see which paths have unsaved changes before choosing a resolution."],"exampleFix":"before: mise dot pull --keep-local ~/.bashrc (fails: unsaved changes) | after: mise dot save ~/.bashrc && mise dot pull --keep-local ~/.bashrc","handlingStrategy":"validation","validationCode":"mise dot status | grep -F '<path>'  # confirm no 'unsaved changes' entry before --keep-local","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `mise dot save` after every intentional edit to a shared dotfile.","Check `mise dot status` before pulling with resolution flags.","On a newly enrolled machine, complete the initial save/setup before using --keep-local."],"tags":["sync","conflict-resolution","dotfiles","git"],"backgroundTag":"conflicting-config-options","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}