jdx/mise · error

could not fetch setup repository using local Git…

Error message

could not fetch setup repository using local Git authentication

What it means

Source::fetch clones/fetches the setup repository with the local `git` binary and expects success, delegating authentication to the user's Git configuration. If the git process exits non-zero (auth failure, network failure, missing repo), mise bails with this message because it cannot surface git's stderr through this API.

Solutions

  1. Verify `git ls-remote <origin>` succeeds in your shell; fix git auth first (SSH key loaded via ssh-agent, or `gh auth setup-git`).
  2. Check network/proxy access to the remote host.
  3. Confirm the origin URL is correct and the repository exists and is accessible to your account.
  4. Retry after fixing credentials — this is a transient/environmental failure, not a code bug.

Example fix

// shell, before running mise
$ mise x -- ...
// error: could not fetch setup repository using local Git authentication
// after
$ ssh-add ~/.ssh/id_ed25519   # or: gh auth login && gh auth setup-git
$ git ls-remote git@github.com:org/repo.git  # verify
$ mise x -- ...
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight before Source::fetch
const ok = require("child_process").execSync(`git ls-remote ${origin} HEAD`, { stdio: "ignore" });

Try / catch

try {
  const source = await Source::fetch(origin);
} catch (e) {
  // message: could not fetch setup repository using local Git authentication
  // run `git ls-remote <origin>` yourself to surface git's real error
  // check ssh-agent / credential helper / network, then retry once
}

Prevention

When it happens

Trigger: Calling Source::fetch(origin) when git fetch fails: expired/absent SSH key, no credential helper for a private HTTPS repo, DNS failure, or the remote rejects the revision.

Common situations: Fresh machines with no `gh auth` / SSH agent running; private repositories without credentials; corporate proxies blocking github.com; VPN not connected.

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/a59f6b3ac14de8fa. Report an issue: GitHub.

Appendix: source

Thrown at src/system/remote_repository.rs:100

        crate::git::sanitize_git_command(&mut command);
        // No checkout: source templates and hooks are never evaluated locally.
        command
            .env("GIT_ALLOW_PROTOCOL", "https:ssh:file")
            .args(["-c", &crate::git::github_credential_config("github.com")])
            .args([
                "-c",
                &crate::git::github_credential_config("github.com:443"),
            ])
            .args(["-c", "http.followRedirects=false"])
            .args(["clone", "--no-checkout", "--no-local", "--"])
            .arg(&origin)
            .arg(&repo);
        let output = tokio::process::Command::from(command)
            .kill_on_drop(true)
            .output()
            .await?;
        if !output.status.success() {
            bail!("could not fetch setup repository using local Git authentication");
        }
        let revision = git_async(&repo, &["rev-parse", "HEAD"]).await?;
        let branch = git_async(&repo, &["symbolic-ref", "HEAD"]).await?;
        let bundle = directory.path().join("repository.bundle");
        git_async(
            &repo,
            &[
                "bundle",
                "create",
                bundle
                    .to_str()
                    .ok_or_else(|| eyre::eyre!("non-UTF8 staging path"))?,
                "HEAD",
                &branch,
            ],
        )
        .await?;
        Ok(Self {

View on GitHub (pinned to 533346cc37)