{"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":"validation","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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/bootstrap.rs#L201-L237","documentation":"During bootstrap validation, the existing checkout's `origin` remote URL does not match the URL mise expects for this bootstrap source, so mise refuses to use it. The error shows both the found and expected URLs.","triggerScenarios":"`validate_bootstrap_checkout` compares `git config --get remote.origin.url` output against the expected bootstrap URL and they differ (exact string comparison, so even trailing `.git` vs no `.git` or https-vs-ssh mismatches trigger it).","commonSituations":"Cloning via SSH (`git@github.com:org/repo.git`) when mise expects HTTPS (or vice versa), forks pointed at a different remote, or the upstream repository being renamed/moved.","solutions":["Set the origin to the expected URL: `git -C <path> remote set-url origin <expected-url>`.","Or delete the checkout and let mise re-clone from the expected URL.","Match the URL form exactly (protocol, `.git` suffix) as printed in the error message."],"exampleFix":"// before\n# origin: git@github.com:jdx/mise.git (expected https://github.com/jdx/mise.git)\ngit -C ~/.local/share/mise/bootstrap/mise remote set-url origin https://github.com/jdx/mise.git\n// after\n# origin now matches; re-run the mise command","handlingStrategy":"validation","validationCode":"origin=$(git -C <path> config --get remote.origin.url 2>/dev/null); [ \"$origin\" = \"<expected-url>\" ] || echo \"origin mismatch: $origin\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clone bootstrap repos with the exact URL form mise expects (same protocol and .git suffix).","Avoid repointing origin of mise-managed checkouts to forks.","When upstream repos move, delete the stale checkout so mise re-clones the new URL."],"tags":["git","bootstrap","remote","url-mismatch"],"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"}