{"record":{"id":"b3731312022aabea","repo":"jdx/mise","slug":"target-raw-target-is-already-managed-by-dotfil","errorCode":null,"errorMessage":"{target_raw}: target is already managed by [dotfiles] edits; remove or rename those entries before adding a whole-file dotfile","messagePattern":"(.+?): target is already managed by \\[dotfiles\\] edits; remove or rename those entries before adding a whole-file dotfile","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/add.rs","lineNumber":181,"sourceCode":"            if target.is_relative() {\n                bail!(\"{target_raw}: target must be absolute or start with ~/\");\n            }\n            if managed\n                .iter()\n                .any(|req| req.mode == FileMode::Track && req.target == target)\n            {\n                bail!(\n                    \"{target_raw}: tracked in place; pass `--mode copy` after `mise dot untrack {target_raw}` to seed a source instead\"\n                );\n            }\n            if managed_edits.iter().any(|req| {\n                system::files::matches_target(\n                    &req.path,\n                    &req.path_raw,\n                    std::slice::from_ref(target_raw),\n                )\n            }) {\n                bail!(\n                    \"{target_raw}: target is already managed by [dotfiles] edits; remove or rename those entries before adding a whole-file dotfile\"\n                );\n            }\n            let existing = managed.iter().find(|req| {\n                system::files::matches_target(\n                    &req.target,\n                    &req.target_raw,\n                    std::slice::from_ref(target_raw),\n                )\n            });\n            let source = if let Some(req) = existing {\n                req.source.clone()\n            } else if let Some(source) = &self.source {\n                file::replace_path(source)\n            } else {\n                system::files::implied_source(&target)?\n            };\n            let write_mode = existing.map(|req| req.mode).unwrap_or(mode);","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/add.rs#L163-L199","documentation":"`mise dot add` refuses to add a whole-file dotfile whose target overlaps a path already managed by a `[dotfiles] edits` entry. Mise does not allow a whole-file entry and a per-file edit entry to fight over the same target, since one would clobber or conflict with the other.","triggerScenarios":"Running `mise dot add <path>` where the target matches (via `system::files::matches_target`) the `path`/`path_raw` of an existing `[dotfiles] edits` request in the managed config.","commonSituations":"User previously configured `[dotfiles] edits` for e.g. a config file and now wants to manage the whole file with `mise dot add`; scripts written before edits entries existed.","solutions":["Remove or rename the conflicting `[dotfiles] edits` entries in the mise config, then re-run `mise dot add`","Change the `mise dot add` target so it no longer overlaps the edited path","Inspect the `[dotfiles] edits` section (grep the config for the target path) to find the conflicting entry"],"exampleFix":"// before (config has [[dotfiles.edits]] path=\"~/.gitconfig\")\n$ mise dot add ~/.gitconfig\n// after: remove the edits entry first\n$ mise dot edit --remove ~/.gitconfig   # or delete the entry from config\n$ mise dot add ~/.gitconfig","handlingStrategy":"validation","validationCode":"// before adding, check the [dotfiles] edits section for the same path\ngrep -F \"$TARGET\" ~/.config/mise/config.toml && echo \"path already under [dotfiles] edits\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep whole-file and edits management for a path mutually exclusive by convention","Search config for the target path before running `mise dot add`"],"tags":["dotfiles","cli","config-conflict"],"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"}