{"record":{"id":"ad6dd598f8640867","repo":"jdx/mise","slug":"is-an-existing-repository-without-the-mise-marker-mise-dot","errorCode":null,"errorMessage":"{} is an existing repository without the mise marker; `mise dot origin set {}` previews how it would be adopted","messagePattern":"(.+?) is an existing repository without the mise marker; `mise dot origin set (.+?)` previews how it would be adopted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/run.rs","lineNumber":294,"sourceCode":"            }\n            // a machine that has never synced has no vanished-branch signal,\n            // so a branch this repository does not have (a declaration that\n            // named the wrong one, or omitted it and took the default) must\n            // not read as an empty upstream either\n            if !found {\n                super::origin::refuse_missing_branch(&remote, &origin.branch, &origin.url)?;\n            }\n            if !found && repo.ref_oid(UPSTREAM_REF)?.is_some() {\n                repo.delete_ref(UPSTREAM_REF)?;\n            }\n            status.last_fetch = Some(hstore::now_rfc3339());\n        }\n        let mut upstream_commit = repo.ref_oid(UPSTREAM_REF)?;\n        outcome.fetched_upstream = upstream_commit.clone();\n        let repo_state = format::detect(repo, upstream_commit.as_deref())?;\n        repo_state.check()?;\n        if repo_state == RepoState::Unmarked && !status.adopted {\n            bail!(\n                \"{} is an existing repository without the mise marker; `mise dot origin set {}` previews how it would be adopted\",\n                origin.url,\n                origin.url\n            );\n        }\n        // ours is the saved version: save what is live first, so a fresh\n        // machine's existing files take part in adoption\n        if request.capture\n            && !(repo\n                .ref_oid(crate::system::history::shadow::HistoryRepo::HISTORY_REF)?\n                .is_none()\n                && upstream_commit.is_some()\n                && tracked.manifest.enrollment.is_empty())\n        {\n            capture_now(store, tracked);\n        }\n        let mut shared = share::current(repo, tracked)?;\n        let unsaved = unsaved_paths(repo, tracked, &shared)?;","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/sync/run.rs#L276-L312","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["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.","Initialize the repository properly through mise so it carries the mise marker before syncing.","If the wrong repository was configured, point the origin at the correct marked repository instead."],"exampleFix":"// before: syncing against an unmarked repo\nmise dot sync // error: <url> is an existing repository without the mise marker\n// after: run the set command to preview and confirm adoption\nmise dot origin set git@example.com:me/dotfiles.git  # preview, then confirm adoption\nmise dot sync","handlingStrategy":"validation","validationCode":"// check adoption status before syncing\nif repo_state == RepoState::Unmarked && !status.adopted {\n    eprintln!(\"preview adoption first: mise dot origin set <url>\");\n    return;\n}","typeGuard":"fn adoption_ready(state: RepoState, adopted: bool) -> bool {\n    state != RepoState::Unmarked || adopted\n}","tryCatchPattern":"match sync() {\n    Err(e) if e.to_string().contains(\"without the mise marker\") => eprintln!(\"run `mise dot origin set <url>` to preview and confirm adoption\"),\n    other => other,\n}","preventionTips":["Only point mise at repositories initialized through mise (with the marker).","When adopting an existing repo, always go through the interactive `mise dot origin set` preview and confirm.","Keep sync status (including the adopted flag) intact; avoid restoring partial state files."],"tags":["git","sync","adoption","repository-state"],"backgroundTag":"invalid-state-transition","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"}