nikivdev/code · error

Merge conflicts with {}. Resolve manually: git status #

Error message

Merge conflicts with {}. Resolve manually:
  git status
  # fix conflicts
  git add . && git commit

What it means

This is the fallback unresolved-conflict error in src/sync.rs, thrown when merge conflicts with the remote ref remain and no repair packet path was available. It instructs the user to resolve conflicts manually using standard git commands. Unlike error 911 there is no packet-based automated fix offered.

Source

Thrown at src/sync.rs:4167

                bail!(
                    "Sync agent cleared raw conflicts for {} but validation and merge finalization are still pending.\nRun `:sync repair --packet {}` or validate and finish the merge manually.",
                    remote_ref,
                    packet_path.display()
                );
            }
            SyncRepairRouteOutcome::Unresolved => {}
        }
    }

    recorder.record(stage, "merge conflicts unresolved");
    if let Some(packet_path) = repair_packet_path {
        bail!(
            "Merge conflicts with {}.\nRun `:sync repair --packet {}` or resolve manually:\n  git status\n  # fix conflicts\n  git add . && git commit",
            remote_ref,
            packet_path.display()
        );
    }
    bail!(
        "Merge conflicts with {}. Resolve manually:\n  git status\n  # fix conflicts\n  git add . && git commit",
        remote_ref
    );
}

fn origin_default_branch_for_feature_sync(
    repo_root: &Path,
    current_branch: &str,
) -> Option<String> {
    let current = current_branch.trim();
    if current.is_empty() || current == "HEAD" {
        return None;
    }
    let default_branch = resolve_remote_default_branch_in(repo_root, "origin")?;
    if current == default_branch {
        return None;
    }
    if !remote_branch_exists(repo_root, "origin", &default_branch) {

View on GitHub (pinned to a747e741ae)

Solutions

  1. Resolve manually: run `git status` to list conflicted files
  2. Edit each conflicted file to pick correct resolutions, removing conflict markers
  3. Run `git add . && git commit` to finalize the merge
  4. Re-run the sync command; consider enabling the repair-packet flow for guided resolution next time

Example fix

// before: conflicted file
<<<<<<< HEAD
foo()
=======
bar()
>>>>>>> origin/main
// after: resolved
foo(); // merged decision
$ git add . && git commit
Defensive patterns

Strategy: fallback

Validate before calling

let out = std::process::Command::new("git").args(["status", "--porcelain"]).output()?;
if !String::from_utf8_lossy(&out.stdout).is_empty() {
    eprintln!("Dirty working tree; commit or stash before sync to reduce conflict risk");
}

Try / catch

match sync_result {
    Err(e) if e.to_string().contains("Resolve manually") => {
        eprintln!("{e}"); // guides user through git status / add / commit
        // optionally fall back to a manual-resolution workflow here
    }
    other => other?,
}

Prevention

When it happens

Trigger: Sync/merge against remote_ref produced conflicts, the repair route ended in `Unresolved`, and `repair_packet_path` was None (no repair packet was generated or provided).

Common situations: Plain `sync` runs without the repair-packet mechanism enabled; environments where packet creation was skipped; long-lived divergent branches with non-trivial conflicts.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/2a742baef60743d6. Report an issue: GitHub.