{"record":{"id":"4e0240ceb38127bd","repo":"jdx/mise","slug":"has-origin-origin-expected-url","errorCode":null,"errorMessage":"{} has origin {origin:?}, expected {url:?}","messagePattern":"(.+?) has origin (.+?), expected (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":219,"sourceCode":"}\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,\n        \"service\" => BootstrapPart::Services,\n        \"firewall\" | \"firewall-rule\" => BootstrapPart::Firewall,\n        \"user\" | \"group\" => BootstrapPart::Accounts,\n        _ => return false,\n    };\n    skip.contains(&part)\n}","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/bootstrap.rs#L201-L237","documentation":"validate_bootstrap_checkout read remote.origin.url from an existing bootstrap checkout and got a URL different from the requested one. The directory is a clone of a different repository, so mise refuses to reuse it to avoid mixing unrelated histories.","triggerScenarios":"Running `mise bootstrap --from <url>` against an existing checkout whose remote.origin.url differs (different host, http vs ssh, .git suffix, different repo).","commonSituations":"Switching dotfile repos; using an HTTPS URL while the checkout was cloned via SSH (or vice versa).","solutions":["Update the checkout's origin to match: `git remote set-url origin <url>`.","Or run bootstrap with the URL the checkout actually uses (check `git remote get-url origin`).","Or remove the checkout and re-clone from the desired URL."],"exampleFix":"// before\nmise bootstrap --from https://github.com/me/dotfiles.git  # origin is git@github.com:me/dotfiles.git\n// after\ngit remote set-url origin https://github.com/me/dotfiles.git","handlingStrategy":"validation","validationCode":"[ \"$(git -C \"$DIR\" remote get-url origin)\" = \"$URL\" ] || echo \"origin mismatch with $URL\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass the exact origin URL (same scheme/host, .git suffix as configured).","Normalize URLs (http vs ssh) before comparing or scripting.","Check `git remote get-url origin` when switching repos."],"tags":["git","bootstrap","url-mismatch"],"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"}