{"record":{"id":"a59f6b3ac14de8fa","repo":"jdx/mise","slug":"could-not-fetch-setup-repository-using-local-git-a","errorCode":null,"errorMessage":"could not fetch setup repository using local Git authentication","messagePattern":"could not fetch setup repository using local Git authentication","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote_repository.rs","lineNumber":100,"sourceCode":"        crate::git::sanitize_git_command(&mut command);\n        // No checkout: source templates and hooks are never evaluated locally.\n        command\n            .env(\"GIT_ALLOW_PROTOCOL\", \"https:ssh:file\")\n            .args([\"-c\", &crate::git::github_credential_config(\"github.com\")])\n            .args([\n                \"-c\",\n                &crate::git::github_credential_config(\"github.com:443\"),\n            ])\n            .args([\"-c\", \"http.followRedirects=false\"])\n            .args([\"clone\", \"--no-checkout\", \"--no-local\", \"--\"])\n            .arg(&origin)\n            .arg(&repo);\n        let output = tokio::process::Command::from(command)\n            .kill_on_drop(true)\n            .output()\n            .await?;\n        if !output.status.success() {\n            bail!(\"could not fetch setup repository using local Git authentication\");\n        }\n        let revision = git_async(&repo, &[\"rev-parse\", \"HEAD\"]).await?;\n        let branch = git_async(&repo, &[\"symbolic-ref\", \"HEAD\"]).await?;\n        let bundle = directory.path().join(\"repository.bundle\");\n        git_async(\n            &repo,\n            &[\n                \"bundle\",\n                \"create\",\n                bundle\n                    .to_str()\n                    .ok_or_else(|| eyre::eyre!(\"non-UTF8 staging path\"))?,\n                \"HEAD\",\n                &branch,\n            ],\n        )\n        .await?;\n        Ok(Self {","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote_repository.rs#L82-L118","documentation":"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.","triggerScenarios":"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.","commonSituations":"Fresh machines with no `gh auth` / SSH agent running; private repositories without credentials; corporate proxies blocking github.com; VPN not connected.","solutions":["Verify `git ls-remote <origin>` succeeds in your shell; fix git auth first (SSH key loaded via ssh-agent, or `gh auth setup-git`).","Check network/proxy access to the remote host.","Confirm the origin URL is correct and the repository exists and is accessible to your account.","Retry after fixing credentials — this is a transient/environmental failure, not a code bug."],"exampleFix":"// shell, before running mise\n$ mise x -- ...\n// error: could not fetch setup repository using local Git authentication\n// after\n$ ssh-add ~/.ssh/id_ed25519   # or: gh auth login && gh auth setup-git\n$ git ls-remote git@github.com:org/repo.git  # verify\n$ mise x -- ...","handlingStrategy":"try-catch","validationCode":"// preflight before Source::fetch\nconst ok = require(\"child_process\").execSync(`git ls-remote ${origin} HEAD`, { stdio: \"ignore\" });","typeGuard":null,"tryCatchPattern":"try {\n  const source = await Source::fetch(origin);\n} catch (e) {\n  // message: could not fetch setup repository using local Git authentication\n  // run `git ls-remote <origin>` yourself to surface git's real error\n  // check ssh-agent / credential helper / network, then retry once\n}","preventionTips":["Run `git ls-remote <origin> HEAD` as a preflight health check.","Keep SSH keys in ssh-agent and run `gh auth setup-git` on fresh machines.","Ensure proxies/VPNs required for the remote are active before onboarding."],"tags":["git","authentication","network","fetch"],"backgroundTag":"git-command-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}