jdx/mise · error

{target_raw}: target is already managed by [dotfiles] edits;

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

A target already covered by a `[dotfiles] edits` entry (line/section edits within a file) cannot additionally be added as a whole-file dotfile — the two mechanisms would fight over the same file. run_inner checks edits_from_config with matches_target and bails if any edit requirement matches the new target, instructing the user to remove or rename those edit entries first.

Source

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

            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 bootstrap dotfiles 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 afd2eddd3a)

Solutions

  1. Remove the matching entry from the [dotfiles] edits section of your config, then re-run add.
  2. Rename/narrow the edit entry's path so it no longer matches the whole-file target, if both behaviors are intended for different files.
  3. Manage the file solely through [dotfiles] edits instead of adding it as a whole-file dotfile.

Example fix

# before (mise.toml)
[dotfiles.edits]
"~/.zshrc" = { ... }
# after — remove or rename the edits entry, then:
mise bootstrap dotfiles add ~/.zshrc
Defensive patterns

Strategy: validation

Validate before calling

// scan config for [dotfiles] edits covering the target before adding
import { readFileSync } from 'node:fs';
const cfg = readFileSync('mise.toml', 'utf8');
if (/\[dotfiles[.a-z]*edits/i.test(cfg)) {
  console.warn('config has [dotfiles] edits — remove matching entries first');
}

Try / catch

try {
  execSync(`mise bootstrap dotfiles add ${target}`);
} catch (e) {
  if (String(e.stderr).includes('already managed by [dotfiles] edits')) {
    console.error('Remove/rename the [dotfiles] edits entry in mise.toml, then retry.');
  } else throw e;
}

Prevention

When it happens

Trigger: Running `mise bootstrap dotfiles add <target>` when the config's [dotfiles] edits section already contains an entry whose path/path_raw matches the target. Note the matching uses raw target strings as well, so a differently-spelled path can still collide.

Common situations: Users who manage a file with targeted edits deciding to manage the whole file; consolidating dotfile configs; inherited config files containing edits for the same dotfile.

Related errors


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