{"record":{"id":"45903d55c7185504","repo":"jdx/mise","slug":"is-an-existing-repository-without-the-mise-mark","errorCode":null,"errorMessage":"{} is an existing repository without the mise marker; `mise bootstrap dotfiles origin set {}` previews how it would be adopted","messagePattern":"(.+?) is an existing repository without the mise marker; `mise bootstrap dotfiles origin set (.+?)` previews how it would be adopted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/run.rs","lineNumber":273,"sourceCode":"            if !found && status.upstream_commit.is_some() {\n                bail!(\n                    \"the setup branch `{}` is not at {} any more (renamed, or deleted?); nothing was changed. `mise bootstrap dotfiles origin set {} --branch <name>` follows a renamed branch\",\n                    origin.branch,\n                    origin.url,\n                    origin.url\n                );\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 bootstrap dotfiles 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":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/run.rs#L255-L291","documentation":"After fetching, mise detects the state of the upstream repository with `format::detect`. If the repo state is `Unmarked` (an existing repository that lacks mise's sync marker commit) and the local status was never marked as adopted, sync aborts: adopting an existing repo would mix its contents into your dotfiles setup without your explicit preview/consent.","triggerScenarios":"`mise bootstrap dotfiles sync` where `format::detect(repo, upstream_commit)` returns `RepoState::Unmarked` and `status.adopted` is false — i.e. the configured origin points at a pre-existing repository that was not initialized by `mise bootstrap dotfiles`.","commonSituations":"Pointing `origin set` at an existing dotfiles repo created by hand or by another tool (bare chezmoi/stow repo, plain git repo); recreating the remote repo fresh without mise's marker.","solutions":["Preview adoption first: run `mise bootstrap dotfiles origin set <url>` again and accept the adoption preview so `status.adopted` is recorded","Initialize the repository with mise's marker by completing the origin-set adoption flow, then sync","If the URL is wrong, point at the intended mise-managed repository: `mise bootstrap dotfiles origin set <correct-url>`"],"exampleFix":"// before\n$ mise bootstrap dotfiles sync\nerror: git@github.com:me/dotfiles.git is an existing repository without the mise marker\n\n// after\n$ mise bootstrap dotfiles origin set git@github.com:me/dotfiles.git  # review adoption preview, confirm\n$ mise bootstrap dotfiles sync","handlingStrategy":"validation","validationCode":"mise bootstrap dotfiles origin set <url>   # review adoption preview before any sync","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only point origin at repositories initialized by `mise bootstrap dotfiles`, or complete the adoption preview first","Avoid reusing pre-existing dotfiles repos as sync origins without adoption"],"tags":["git","sync","dotfiles","adoption","safety-check"],"backgroundTag":"invalid-state-transition","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}