jdx/mise · error

is an existing repository without the mise marker; `mise…

Error message

{} is an existing repository without the mise marker; `mise dot origin set {}` previews how it would be adopted

What it means

When syncing, mise detects the state of the target repository via format::detect. If the upstream repository exists but lacks the mise marker and this machine has not recorded an explicit adoption (status.adopted), sync refuses to proceed, since adopting an unmarked repository could clobber or misinterpret existing content. The suggested command previews the adoption first.

Solutions

  1. Preview the adoption with `mise dot origin set <url>` (as the message suggests) and confirm to mark the repository as adopted, then re-run sync.
  2. Initialize the repository properly through mise so it carries the mise marker before syncing.
  3. If the wrong repository was configured, point the origin at the correct marked repository instead.

Example fix

// before: syncing against an unmarked repo
mise dot sync // error: <url> is an existing repository without the mise marker
// after: run the set command to preview and confirm adoption
mise dot origin set git@example.com:me/dotfiles.git  # preview, then confirm adoption
mise dot sync
Defensive patterns

Strategy: validation

Validate before calling

// check adoption status before syncing
if repo_state == RepoState::Unmarked && !status.adopted {
    eprintln!("preview adoption first: mise dot origin set <url>");
    return;
}

Type guard

fn adoption_ready(state: RepoState, adopted: bool) -> bool {
    state != RepoState::Unmarked || adopted
}

Try / catch

match sync() {
    Err(e) if e.to_string().contains("without the mise marker") => eprintln!("run `mise dot origin set <url>` to preview and confirm adoption"),
    other => other,
}

Prevention

When it happens

Trigger: `mise dot origin set <url>` pointing at a pre-existing repository that was not initialized by mise (no marker commit/annotation at the upstream ref), followed by a sync, while status.adopted is false.

Common situations: Pointing mise at a plain existing dotfiles Git repo created by hand or another tool; switching origin to a coworker's repo without adopting it; restoring state from backup where the adopted flag was lost.

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


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

Appendix: source

Thrown at src/system/history/sync/run.rs:294

            }
            // a machine that has never synced has no vanished-branch signal,
            // so a branch this repository does not have (a declaration that
            // named the wrong one, or omitted it and took the default) must
            // not read as an empty upstream either
            if !found {
                super::origin::refuse_missing_branch(&remote, &origin.branch, &origin.url)?;
            }
            if !found && repo.ref_oid(UPSTREAM_REF)?.is_some() {
                repo.delete_ref(UPSTREAM_REF)?;
            }
            status.last_fetch = Some(hstore::now_rfc3339());
        }
        let mut upstream_commit = repo.ref_oid(UPSTREAM_REF)?;
        outcome.fetched_upstream = upstream_commit.clone();
        let repo_state = format::detect(repo, upstream_commit.as_deref())?;
        repo_state.check()?;
        if repo_state == RepoState::Unmarked && !status.adopted {
            bail!(
                "{} is an existing repository without the mise marker; `mise dot origin set {}` previews how it would be adopted",
                origin.url,
                origin.url
            );
        }
        // ours is the saved version: save what is live first, so a fresh
        // machine's existing files take part in adoption
        if request.capture
            && !(repo
                .ref_oid(crate::system::history::shadow::HistoryRepo::HISTORY_REF)?
                .is_none()
                && upstream_commit.is_some()
                && tracked.manifest.enrollment.is_empty())
        {
            capture_now(store, tracked);
        }
        let mut shared = share::current(repo, tracked)?;
        let unsaved = unsaved_paths(repo, tracked, &shared)?;

View on GitHub (pinned to 533346cc37)