{"record":{"id":"eb5bb72a4d6fac54","repo":"jdx/mise","slug":"exists-but-is-not-a-git-checkout-with-an-origin","errorCode":null,"errorMessage":"{} exists but is not a git checkout with an origin remote","messagePattern":"(.+?) exists but is not a git checkout with an origin remote","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":212,"sourceCode":"    command.arg(\"-C\").arg(checkout).args(args);\n    crate::git::sanitize_git_command(&mut command);\n    let status = command.status()?;\n    if !status.success() {\n        bail!(\"git command failed with {status}\");\n    }\n    Ok(())\n}\n\nfn validate_bootstrap_checkout(checkout: &Path, url: &str) -> Result<()> {\n    let mut command = Command::new(\"git\");\n    command\n        .arg(\"-C\")\n        .arg(checkout)\n        .args([\"config\", \"--get\", \"remote.origin.url\"]);\n    crate::git::sanitize_git_command(&mut command);\n    let output = command.output()?;\n    if !output.status.success() {\n        bail!(\n            \"{} exists but is not a git checkout with an origin remote\",\n            checkout.display_user()\n        );\n    }\n    let origin = String::from_utf8(output.stdout)?.trim().to_string();\n    if origin != url {\n        bail!(\n            \"{} has origin {origin:?}, expected {url:?}\",\n            checkout.display_user()\n        );\n    }\n    Ok(())\n}\n\nfn bootstrap_resource_is_skipped(resource: &ResourceId, skip: &HashSet<BootstrapPart>) -> bool {\n    let part = match resource.kind.as_str() {\n        \"package\" => BootstrapPart::Packages,\n        \"file\" | \"directory\" => BootstrapPart::Files,","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/bootstrap.rs#L194-L230","documentation":"mise's bootstrap found an existing directory at the expected checkout path, but it is not a git checkout with an `origin` remote (the `git config --get remote.origin.url` call failed), so mise refuses to reuse it. This guards against reusing a non-git or misconfigured directory as a bootstrap checkout.","triggerScenarios":"`run_from` bootstrap flow finds `<bootstrap-dir>` present but plain/uninitialized or a git repo without an origin remote, making `git config --get remote.origin.url` exit non-zero.","commonSituations":"A stale plain directory created manually at the bootstrap path, a repo cloned then its origin removed, or a partially initialized checkout left by an interrupted run.","solutions":["Delete the stale directory and let mise re-clone it (e.g. `rm -rf <bootstrap-checkout-path>` then re-run).","If the directory should be kept, add the correct origin: `git -C <path> remote add origin <url>`.","Re-initialize the checkout with the intended URL so the origin remote matches."],"exampleFix":"// before: keeping a repo without origin\n# (mise errors)\n// after\ngit -C ~/.local/share/mise/bootstrap/repo remote add origin https://github.com/org/repo.git","handlingStrategy":"validation","validationCode":"test -d <path>/.git && git -C <path> config --get remote.origin.url >/dev/null 2>&1 || echo 'not a git checkout with origin; remove it so mise re-clones'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not create files/directories manually at mise bootstrap paths.","Keep origin remotes intact on any repo mise manages.","Clean up interrupted checkouts rather than leaving partial clones."],"tags":["git","bootstrap","validation","remote"],"backgroundTag":"git-command-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}