gitbutlerapp/gitbutler · error · anyhow::Error

Refusing to land `{branch}`: {} commit(s) on unnamed segment

Error message

Refusing to land `{branch}`: {} commit(s) on unnamed segment(s) below it would also be published to {target_display}. Pass --whole-stack to land `{branch}` together with everything below it.

What it means

Error "Refusing to land `{branch}`: {} commit(s) on unnamed segment(s) below it would also be published to {target_display}. Pass --whole-stack to land `{branch}` together with everything below it." thrown in gitbutlerapp/gitbutler.

Source

Thrown at crates/but-api/src/land/mod.rs:427

        // deleted still holds commits that "land the entire stack" would have to include.
        if let Some(top) = scan.upper_segments.first() {
            bail!(
                "Refusing to land `{branch}` with --whole-stack: it is not the top of its stack. \
                 --whole-stack lands the entire stack; name its top segment `{top}` instead.",
            );
        }
        bail!(
            "Refusing to land `{branch}` with --whole-stack: it is not the top of its stack — \
             unnamed segment(s) with commits sit above it (their branch refs no longer exist), so \
             landing `{branch}` would not land the entire stack.",
        );
    }
    // Key off the commits below, not the segment names: segments whose branch ref was deleted are
    // unnamed but their commits would be published all the same.
    let publishes_below = scan.commits_below > 0 || !scan.lower_segments.is_empty();
    if publishes_below && !whole_stack {
        if scan.lower_segments.is_empty() {
            bail!(
                "Refusing to land `{branch}`: {} commit(s) on unnamed segment(s) below it would \
                 also be published to {target_display}. Pass --whole-stack to land `{branch}` \
                 together with everything below it.",
                scan.commits_below,
            );
        }
        bail!(
            "Refusing to land `{branch}`: it is stacked on top of {} other segment(s) ({}) \
             whose commits would also be published to {target_display}. Land the bottom segment \
             `{}`, or pass --whole-stack to land `{branch}` together with everything below it.",
            scan.lower_segments.len(),
            scan.lower_segments.join(", "),
            scan.lower_segments.last().expect("non-empty checked above"),
        );
    }

    if !scan.conflicted.is_empty() {
        bail!(

View on GitHub (pinned to caf1f223d3)

When it happens

Trigger: Thrown at crates/but-api/src/land/mod.rs:427 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20). Data as JSON: /api/errors/c6cdd6fad98d4893. Report an issue: GitHub.