GitoxideLabs/gitoxide · error

One or more errors occurred - checkout is incomplete

Error message

One or more errors occurred - checkout is incomplete: {}

What it means

After checkout during clone, the outcome is inspected: if it ended with errors (e.g. filesystem collisions or IO errors), the clone aborts with a summary message listing each error kind. The checkout itself reported failures, so the working tree is incomplete.

Solutions

  1. Read the collision list written to stderr, remove/rename the offending paths, and retry
  2. Clone into an empty directory
  3. On case-insensitive filesystems, configure `core.protectNTFS`/checkout collision handling or use a case-sensitive volume
  4. Retry with checkout disabled (`--no-checkout`) if only the objects are needed

Example fix

// before
gix::clone::PrepareFetch::from_url(url)?.fetch_only(progress, &mut should_interrupt)?;
// after
let prep = gix::clone::PrepareFetch::from_url(url)?.with_empty_path()?;
let (repo, outcome) = prep.fetch_then_checkout(progress, &mut should_interrupt)?.0;
match outcome {
    gix::checkout::box_overwrites::OutcomeOrError::Outcome(_) => {},
    e => return Err(anyhow!("checkout failed: {e}")),
}
Defensive patterns

Strategy: try-catch

Validate before calling

if !target_dir.is_empty() {
    anyhow::bail!("target directory must be empty before clone");
}

Try / catch

match clone_result {
    Err(e) if e.to_string().contains("checkout is incomplete") => {
        eprintln!("fix collisions listed on stderr, then retry");
    }
    Err(e) => return Err(e),
    Ok(()) => {},
}

Prevention

When it happens

Trigger: Cloning a repo whose checkout collides with existing files on disk (case-insensitive filesystems, symlinks, pre-existing untracked paths), or checkout errors like permission/IO failures during `clone` with `checkout: Some(...)`.

Common situations: Cloning onto Windows/macOS where filenames differ only by case; cloning into a non-empty directory; path-too-long or permission errors during checkout.

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 GitoxideLabs/gitoxide@e73179060b (2026-09-08). Data as JSON: /api/errors/fdc15f02f36fb1a8. Report an issue: GitHub.

Appendix: source

Thrown at gitoxide-core/src/repository/clone.rs:139

        match outcome {
            Some(gix::worktree::state::checkout::Outcome { collisions, errors, .. })
                if !(collisions.is_empty() && errors.is_empty()) =>
            {
                let mut messages = Vec::new();
                if !errors.is_empty() {
                    messages.push(format!("kept going through {} errors(s)", errors.len()));
                    for record in errors {
                        writeln!(err, "{}: {}", record.path, record.error).ok();
                    }
                }
                if !collisions.is_empty() {
                    messages.push(format!("encountered {} collision(s)", collisions.len()));
                    for col in collisions {
                        writeln!(err, "{}: collision ({:?})", col.path, col.error_kind).ok();
                    }
                }
                bail!(
                    "One or more errors occurred - checkout is incomplete: {}",
                    messages.join(", ")
                );
            }
            _ => {}
        }
        Ok(())
    }
}

View on GitHub (pinned to e73179060b)