{"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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/bootstrap.rs#L180-L216","documentation":"A git subprocess launched during mise's bootstrap (clone/fetch/checkout of a bootstrap repository) exited with a non-zero status. The error carries git's exit-status rendering so the underlying cause must be read from git's stderr output.","triggerScenarios":"`run_bootstrap_git` invoked with args like clone/fetch/checkout against a URL that is unreachable, requires auth, or whose ref does not exist; `Command::status()` succeeded but the exit code was non-zero.","commonSituations":"Private repositories without credentials, network outages or proxies blocking github.com, mistyped branch/tag names, or an absent/misconfigured local git.","solutions":["Re-run with MISE_DEBUG=1 to see the git stderr and fix the underlying git failure.","Verify the repository URL and that the target ref (branch/tag) exists.","Check network/auth: `git ls-remote <url>` should succeed outside mise.","Ensure `git` is installed and on PATH."],"exampleFix":"// before (referring to a nonexistent ref)\nrun_bootstrap_git(checkout, [\"checkout\", \"no-such-branch\"])\n// after\nrun_bootstrap_git(checkout, [\"checkout\", \"main\"])","handlingStrategy":"retry","validationCode":"git ls-remote <bootstrap-url> >/dev/null 2>&1 || echo 'repository unreachable or ref missing'","typeGuard":null,"tryCatchPattern":"match result {\n  Err(e) if e.to_string().contains(\"git command failed\") => {\n    eprintln!(\"git failed: {e}; retrying after network check\");\n    // retry with backoff or surface git stderr via MISE_DEBUG=1\n  }\n  r => r?,\n}","preventionTips":["Confirm network/proxy access to the repository host before running mise bootstrap.","Authenticate private repos (SSH keys or credentials helper) ahead of time.","Pin bootstrap refs that actually exist (branch/tag).","Run with MISE_DEBUG=1 to capture git stderr for diagnosis."],"tags":["git","subprocess","bootstrap","network"],"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-14T00:17:10.932Z"}