jdx/mise · error

git command failed with

Error message

git command failed with {status}

What it means

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.

Solutions

  1. Run the same git command manually in the checkout directory to see the underlying error.
  2. Check network access and credentials for the bootstrap repository URL.
  3. Delete the stale checkout directory and re-run `mise bootstrap --from <url>` so it is re-cloned.

Example fix

// before
mise bootstrap --from https://github.com/me/private-dotfiles  # auth fails
// after
git config credential.helper store  # or use SSH URL
mise bootstrap --from git@github.com:me/private-dotfiles.git
Defensive patterns

Strategy: retry

Validate before calling

git ls-remote <url> >/dev/null 2>&1 || echo "cannot reach bootstrap repo"

Try / catch

if ! mise bootstrap --from "$URL"; then git -C "$(mise dot status --json | jq -r .checkout)" fetch --all && mise bootstrap --from "$URL"; fi

Prevention

When it happens

Trigger: 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.

Common situations: Offline machine; private repo without credentials; corrupted or partially-cloned checkout directory; remote branch deleted.

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@533346cc37 (2026-09-17). Data as JSON: /api/errors/79449628af679c83. Report an issue: GitHub.

Appendix: 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 533346cc37)