{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/bootstrap.rs#L194-L230","documentation":"The bootstrap `--from` target directory exists but `git config --get remote.origin.url` failed, meaning it is not a git checkout with an origin remote. Mise refuses to treat the directory as a bootstrap checkout.","triggerScenarios":"Running `mise bootstrap --from <url>` where the checkout path already exists as a plain (non-git) directory, or a git repo without an 'origin' remote.","commonSituations":"A dotfiles directory that was copied rather than cloned; a repo cloned with a differently-named remote (e.g. upstream instead of origin).","solutions":["Rename `upstream`/other remotes to `origin`: `git remote rename upstream origin`.","If the directory is not a git repo, back it up, remove it, and let bootstrap clone fresh.","Point --from at a path that is a proper clone with an origin remote."],"exampleFix":"// before\ngit remote -v  # shows 'upstream'\n// after\ngit remote rename upstream origin","handlingStrategy":"validation","validationCode":"git -C \"$DIR\" config --get remote.origin.url >/dev/null 2>&1 || echo \"$DIR is not a git checkout with origin\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always clone dotfiles with origin remote (default when cloning).","Don't bootstrap into a copied (non-git) directory.","Rename non-origin remotes to origin."],"tags":["git","bootstrap"],"backgroundTag":"invalid-argument-value","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"}