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

  1. Re-run with MISE_DEBUG=1 to see the git stderr and fix the underlying git failure.
  2. Verify the repository URL and that the target ref (branch/tag) exists.
  3. Check network/auth: `git ls-remote <url>` should succeed outside mise.
  4. 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

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


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/79449628af679c83. Report an issue: GitHub.