{"record":{"id":"79449628af679c83","repo":"jdx/mise","slug":"git-command-failed-with-status","errorCode":null,"errorMessage":"git command failed with {status}","messagePattern":"git command failed with (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":198,"sourceCode":"        Self::Defaults,\n        Self::Launchd,\n        Self::Systemd,\n        Self::User,\n        Self::Tools,\n        Self::Task,\n        Self::FinalHook,\n    ];\n}\n\ntype BootstrapPredictionGraph = HashMap<ResourceId, (ResourceAction, Vec<ResourceId>)>;\n\nfn run_bootstrap_git<const N: usize>(checkout: &Path, args: [&str; N]) -> Result<()> {\n    let mut command = Command::new(\"git\");\n    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    }","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/bootstrap.rs#L180-L216","documentation":"run_bootstrap_git ran a sanitized `git -C <checkout> ...` command and git exited non-zero; the message embeds the exit status. It signals the underlying git operation (fetch/reset/etc. during bootstrap checkout maintenance) failed — inspect stderr printed by git for the real cause.","triggerScenarios":"Any git operation in run_bootstrap_git (clone/fetch/checkout steps of `mise bootstrap --from <url>`) failing — bad URL, network failure, merge conflict, missing ref.","commonSituations":"Offline machine; private repo without credentials; corrupted or partially-cloned checkout directory; remote branch deleted.","solutions":["Run the same git command manually in the checkout directory to see the underlying error.","Check network access and credentials for the bootstrap repository URL.","Delete the stale checkout directory and re-run `mise bootstrap --from <url>` so it is re-cloned."],"exampleFix":"// before\nmise bootstrap --from https://github.com/me/private-dotfiles  # auth fails\n// after\ngit config credential.helper store  # or use SSH URL\nmise bootstrap --from git@github.com:me/private-dotfiles.git","handlingStrategy":"retry","validationCode":"git ls-remote <url> >/dev/null 2>&1 || echo \"cannot reach bootstrap repo\"","typeGuard":null,"tryCatchPattern":"if ! mise bootstrap --from \"$URL\"; then git -C \"$(mise dot status --json | jq -r .checkout)\" fetch --all && mise bootstrap --from \"$URL\"; fi","preventionTips":["Verify network and credentials before bootstrapping.","Use SSH URLs for private repos with keys configured.","Re-clone the checkout if it becomes corrupted."],"tags":["git","bootstrap","network"],"backgroundTag":"git-command-failed","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"}