jdx/mise · error
{target_raw}: tracked in place; pass `--mode copy` after `mi
Error message
{target_raw}: tracked in place; pass `--mode copy` after `mise bootstrap dotfiles untrack {target_raw}` to seed a source instead What it means
If the target already has a FileMode::Track requirement in the managed dotfile set, adding it as copy/symlink would conflict with the existing in-place tracking. run_inner detects the overlap and bails, telling the user to untrack the file first and then add it with `--mode copy` so a source copy can be seeded from the currently tracked file.
Source
Thrown at src/cli/dotfiles/add.rs:165
cwd: None,
prefer_toml: true,
prevent_home_local: true,
})?;
let mut planned = vec![];
let managed_edits = system::edits::edits_from_config(&config)?;
for target_raw in &self.targets {
let target = system::files::resolve_target_arg(target_raw)
.components()
.collect::<PathBuf>();
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,View on GitHub (pinned to afd2eddd3a)
Solutions
- Run `mise bootstrap dotfiles untrack <target>` first, then add with `--mode copy` to seed a source.
- Keep tracking the file and drop the add attempt if in-place tracking is what you want.
- Check existing entries with the dotfiles list/show command to confirm the current mode.
Example fix
# before mise bootstrap dotfiles add ~/.zshrc --mode copy # after mise bootstrap dotfiles untrack ~/.zshrc mise bootstrap dotfiles add ~/.zshrc --mode copy
Defensive patterns
Strategy: validation
Validate before calling
// check current mode before switching
const list = execSync(`mise bootstrap dotfiles ls --json`).toString();
const managed = JSON.parse(list);
if (managed.some(d => d.target === target && d.mode === 'track')) {
execSync(`mise bootstrap dotfiles untrack ${target}`);
} Try / catch
try {
execSync(`mise bootstrap dotfiles add ${target} --mode copy`);
} catch (e) {
if (String(e.stderr).includes('tracked in place')) {
execSync(`mise bootstrap dotfiles untrack ${target}`);
execSync(`mise bootstrap dotfiles add ${target} --mode copy`);
} else throw e;
} Prevention
- List current dotfile entries before changing a file's management mode.
- Standardize on one management style (track vs copy) per file to avoid mode conflicts.
When it happens
Trigger: Running `mise bootstrap dotfiles add <target>` (default or --mode copy/symlink) on a file that is already tracked via a previous `dotfiles track` or a [dotfiles] track entry. Also fired when the --source-only rename flow hits an already-tracked target.
Common situations: Migrating a file from track-based to copy-based management; re-running setup scripts that mix `track` and `add`; forgetting an earlier tracking entry exists in config.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- {target_raw}: target is already managed by [dotfiles] edits;
- cannot connect a setup repository: {reason}
- cannot apply: {reason}
- --changed does not accept target arguments
- at least one target or --changed is required
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/6004b93d73fdc385.
Report an issue: GitHub.