jdx/mise · error

exists but is not a git checkout with an origin remote

Error message

{} exists but is not a git checkout with an origin remote

What it means

The bootstrap `--from` target directory exists but `git config --get remote.origin.url` failed, meaning it is not a git checkout with an origin remote. Mise refuses to treat the directory as a bootstrap checkout.

Solutions

  1. Rename `upstream`/other remotes to `origin`: `git remote rename upstream origin`.
  2. If the directory is not a git repo, back it up, remove it, and let bootstrap clone fresh.
  3. Point --from at a path that is a proper clone with an origin remote.

Example fix

// before
git remote -v  # shows 'upstream'
// after
git remote rename upstream origin
Defensive patterns

Strategy: validation

Validate before calling

git -C "$DIR" config --get remote.origin.url >/dev/null 2>&1 || echo "$DIR is not a git checkout with origin"

Prevention

When it happens

Trigger: Running `mise bootstrap --from <url>` where the checkout path already exists as a plain (non-git) directory, or a git repo without an 'origin' remote.

Common situations: A dotfiles directory that was copied rather than cloned; a repo cloned with a differently-named remote (e.g. upstream instead of origin).

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/eb5bb72a4d6fac54. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/bootstrap.rs:212

    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()
        );
    }
    let origin = String::from_utf8(output.stdout)?.trim().to_string();
    if origin != url {
        bail!(
            "{} has origin {origin:?}, expected {url:?}",
            checkout.display_user()
        );
    }
    Ok(())
}

fn bootstrap_resource_is_skipped(resource: &ResourceId, skip: &HashSet<BootstrapPart>) -> bool {
    let part = match resource.kind.as_str() {
        "package" => BootstrapPart::Packages,
        "file" | "directory" => BootstrapPart::Files,

View on GitHub (pinned to 533346cc37)