{"record":{"id":"2a742baef60743d6","repo":"nikivdev/code","slug":"merge-conflicts-with-resolve-manually-git-s","errorCode":null,"errorMessage":"Merge conflicts with {}. Resolve manually:\n  git status\n  # fix conflicts\n  git add . && git commit","messagePattern":"Merge conflicts with (.+?)\\. Resolve manually:\n  git status\n  # fix conflicts\n  git add \\. && git commit","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sync.rs","lineNumber":4167,"sourceCode":"                bail!(\n                    \"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.\",\n                    remote_ref,\n                    packet_path.display()\n                );\n            }\n            SyncRepairRouteOutcome::Unresolved => {}\n        }\n    }\n\n    recorder.record(stage, \"merge conflicts unresolved\");\n    if let Some(packet_path) = repair_packet_path {\n        bail!(\n            \"Merge conflicts with {}.\\nRun `:sync repair --packet {}` or resolve manually:\\n  git status\\n  # fix conflicts\\n  git add . && git commit\",\n            remote_ref,\n            packet_path.display()\n        );\n    }\n    bail!(\n        \"Merge conflicts with {}. Resolve manually:\\n  git status\\n  # fix conflicts\\n  git add . && git commit\",\n        remote_ref\n    );\n}\n\nfn origin_default_branch_for_feature_sync(\n    repo_root: &Path,\n    current_branch: &str,\n) -> Option<String> {\n    let current = current_branch.trim();\n    if current.is_empty() || current == \"HEAD\" {\n        return None;\n    }\n    let default_branch = resolve_remote_default_branch_in(repo_root, \"origin\")?;\n    if current == default_branch {\n        return None;\n    }\n    if !remote_branch_exists(repo_root, \"origin\", &default_branch) {","sourceCodeStart":4149,"sourceCodeEnd":4185,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/sync.rs#L4149-L4185","documentation":"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.","triggerScenarios":"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).","commonSituations":"Plain `sync` runs without the repair-packet mechanism enabled; environments where packet creation was skipped; long-lived divergent branches with non-trivial conflicts.","solutions":["Resolve manually: run `git status` to list conflicted files","Edit each conflicted file to pick correct resolutions, removing conflict markers","Run `git add . && git commit` to finalize the merge","Re-run the sync command; consider enabling the repair-packet flow for guided resolution next time"],"exampleFix":"// before: conflicted file\n<<<<<<< HEAD\nfoo()\n=======\nbar()\n>>>>>>> origin/main\n// after: resolved\nfoo(); // merged decision\n$ git add . && git commit","handlingStrategy":"fallback","validationCode":"let out = std::process::Command::new(\"git\").args([\"status\", \"--porcelain\"]).output()?;\nif !String::from_utf8_lossy(&out.stdout).is_empty() {\n    eprintln!(\"Dirty working tree; commit or stash before sync to reduce conflict risk\");\n}","typeGuard":null,"tryCatchPattern":"match sync_result {\n    Err(e) if e.to_string().contains(\"Resolve manually\") => {\n        eprintln!(\"{e}\"); // guides user through git status / add / commit\n        // optionally fall back to a manual-resolution workflow here\n    }\n    other => other?,\n}","preventionTips":["Keep local branch rebased on the remote before syncing","Commit or stash local work before running sync","Enable the repair-packet flow when available for guided resolution","Communicate ownership of files to reduce overlapping edits"],"tags":["git","merge-conflicts","sync","manual-resolution"],"backgroundTag":"merge-conflicts-unresolved","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}