jdx/mise · error
git command failed with {status}
Error message
git command failed with {status} What it means
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.
Source
Thrown at src/cli/bootstrap.rs:198
Self::Defaults,
Self::Launchd,
Self::Systemd,
Self::User,
Self::Tools,
Self::Task,
Self::FinalHook,
];
}
type BootstrapPredictionGraph = HashMap<ResourceId, (ResourceAction, Vec<ResourceId>)>;
fn run_bootstrap_git<const N: usize>(checkout: &Path, args: [&str; N]) -> Result<()> {
let mut command = Command::new("git");
command.arg("-C").arg(checkout).args(args);
crate::git::sanitize_git_command(&mut command);
let status = command.status()?;
if !status.success() {
bail!("git command failed with {status}");
}
Ok(())
}
fn validate_bootstrap_checkout(checkout: &Path, url: &str) -> Result<()> {
let mut command = Command::new("git");
command
.arg("-C")
.arg(checkout)
.args(["config", "--get", "remote.origin.url"]);
crate::git::sanitize_git_command(&mut command);
let output = command.output()?;
if !output.status.success() {
bail!(
"{} exists but is not a git checkout with an origin remote",
checkout.display_user()
);
}View on GitHub (pinned to afd2eddd3a)
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.
Example fix
// before (referring to a nonexistent ref) run_bootstrap_git(checkout, ["checkout", "no-such-branch"]) // after run_bootstrap_git(checkout, ["checkout", "main"])
Defensive patterns
Strategy: retry
Validate before calling
git ls-remote <bootstrap-url> >/dev/null 2>&1 || echo 'repository unreachable or ref missing'
Try / catch
match result {
Err(e) if e.to_string().contains("git command failed") => {
eprintln!("git failed: {e}; retrying after network check");
// retry with backoff or surface git stderr via MISE_DEBUG=1
}
r => r?,
} Prevention
- 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.
When it happens
Trigger: `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.
Common situations: Private repositories without credentials, network outages or proxies blocking github.com, mistyped branch/tag names, or an absent/misconfigured local git.
Understand the failure class
Background: "git command failed": what it means when a tool shells out to git and git exits non-zero — this error's family across 21 libraries.
Related errors
- cannot encode #{value.class} as JSON
- {} exists but is not a git checkout with an origin remote
- {} has origin {origin:?}, expected {url:?}
- bootstrap from repository failed with {status}
- git clone failed with {status}
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/79449628af679c83.
Report an issue: GitHub.