jdx/mise · error

: target is already managed by [dotfiles] edits; remove or…

Error message

{target_raw}: target is already managed by [dotfiles] edits; remove or rename those entries before adding a whole-file dotfile

What it means

`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.

Solutions

  1. Remove or rename the conflicting `[dotfiles] edits` entries in the mise config, then re-run `mise dot add`
  2. Change the `mise dot add` target so it no longer overlaps the edited path
  3. Inspect the `[dotfiles] edits` section (grep the config for the target path) to find the conflicting entry

Example fix

// before (config has [[dotfiles.edits]] path="~/.gitconfig")
$ mise dot add ~/.gitconfig
// after: remove the edits entry first
$ mise dot edit --remove ~/.gitconfig   # or delete the entry from config
$ mise dot add ~/.gitconfig
Defensive patterns

Strategy: validation

Validate before calling

// before adding, check the [dotfiles] edits section for the same path
grep -F "$TARGET" ~/.config/mise/config.toml && echo "path already under [dotfiles] edits"

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/b3731312022aabea. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/dotfiles/add.rs:181

            if target.is_relative() {
                bail!("{target_raw}: target must be absolute or start with ~/");
            }
            if managed
                .iter()
                .any(|req| req.mode == FileMode::Track && req.target == target)
            {
                bail!(
                    "{target_raw}: tracked in place; pass `--mode copy` after `mise dot untrack {target_raw}` to seed a source instead"
                );
            }
            if managed_edits.iter().any(|req| {
                system::files::matches_target(
                    &req.path,
                    &req.path_raw,
                    std::slice::from_ref(target_raw),
                )
            }) {
                bail!(
                    "{target_raw}: target is already managed by [dotfiles] edits; remove or rename those entries before adding a whole-file dotfile"
                );
            }
            let existing = managed.iter().find(|req| {
                system::files::matches_target(
                    &req.target,
                    &req.target_raw,
                    std::slice::from_ref(target_raw),
                )
            });
            let source = if let Some(req) = existing {
                req.source.clone()
            } else if let Some(source) = &self.source {
                file::replace_path(source)
            } else {
                system::files::implied_source(&target)?
            };
            let write_mode = existing.map(|req| req.mode).unwrap_or(mode);

View on GitHub (pinned to 533346cc37)