{"record":{"id":"9507937fc25f010c","repo":"nikivdev/code","slug":"rebase-conflict-manual-resolution-required","errorCode":null,"errorMessage":"Rebase conflict - manual resolution required","messagePattern":"Rebase conflict - manual resolution required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/commit.rs","lineNumber":2164,"sourceCode":"                        println!(\"done\");\n                        print!(\"Pushing... \");\n                        io::stdout().flush()?;\n                        git_push_run(&push_remote, &push_branch)?;\n                        println!(\"done\");\n                        info!(\"pulled and pushed to remote\");\n                        pushed = true;\n                    }\n                    Err(_) => {\n                        println!(\"conflict!\");\n                        println!();\n                        println!(\"Rebase conflict detected. Resolve manually:\");\n                        println!(\"  1. Fix conflicts in the listed files\");\n                        println!(\"  2. git add <files>\");\n                        println!(\"  3. git rebase --continue\");\n                        println!(\"  4. git push\");\n                        println!();\n                        println!(\"Or abort with: git rebase --abort\");\n                        bail!(\"Rebase conflict - manual resolution required\");\n                    }\n                }\n            }\n        }\n    }\n\n    // Record undo action\n    record_undo_action(&repo_root, pushed, Some(&message));\n\n    // Sync mirrors with AI sessions since previous checkpoint.\n    let cwd = std::env::current_dir().unwrap_or_default();\n    let sync_gitedit = gitedit_globally_enabled() && gitedit_mirror_enabled_for_commit(&repo_root);\n    let sync_myflow = myflow_mirror_enabled(&repo_root);\n    let (sync_sessions, sync_window) = if sync_gitedit || sync_myflow {\n        let (sessions, window) = collect_sync_sessions_for_commit_with_window(&repo_root);\n        (sessions, Some(window))\n    } else {\n        (Vec::new(), None)","sourceCodeStart":2146,"sourceCodeEnd":2182,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L2146-L2182","documentation":"This library wraps `git rebase` during a push/commit workflow. When the rebase stops due to merge conflicts, it detects the conflicted state and fails fast with this error instead of silently continuing. It is intentional: the conflict requires human resolution, and the library prints the exact steps to finish (fix files, git add, git rebase --continue, git push) or abort.","triggerScenarios":"Calling the commit/push flow (which runs an internal `git rebase` before push) when the upstream branch has commits that conflict with local commits; `git rebase` exits non-zero with unmerged paths in the worktree.","commonSituations":"Pulling changes from teammates whose edits overlap yours on the same lines; long-lived feature branches behind main; cherry-picked or reordered commits colliding with upstream changes.","solutions":["Run `git status` to list conflicted files, edit them to resolve conflict markers, then `git add <files>`.","Run `git rebase --continue` (repeat resolve/continue for each conflicted commit), then push.","If the rebase is undesired, run `git rebase --abort` to return to the pre-rebase state.","Prevent recurrence by rebasing regularly (`git fetch && git rebase origin/main`) so conflicts stay small."],"exampleFix":"// before: pushing a stale branch that fails mid-rebase\n// $ rebase conflict in src/main.rs\n<<<<<<< HEAD\nlet x = upstream_value();\n=======\nlet x = my_value();\n>>>>>>> my-branch\n// after: resolve markers, keep correct code, stage and continue\nlet x = merged_value();\n// $ git add src/main.rs && git rebase --continue && git push","handlingStrategy":"validation","validationCode":"// Before invoking the flow, check for a dirty rebase/conflict state\nlet out = Command::new(\"git\").args([\"status\", \"--porcelain\"]).output()?;\nlet conflicted = String::from_utf8_lossy(&out.stdout)\n    .lines()\n    .any(|l| l.starts_with(\"UU\") || l.starts_with(\"AA\") || l.starts_with(\"DD\"));\nif conflicted { /* resolve or abort rebase first */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Rebase onto the target branch frequently to keep conflicts small.","Never start the commit/push flow while a rebase is in progress (check for .git/rebase-merge).","Run `git status --porcelain` as a preflight and refuse to proceed on conflict markers."],"tags":["git","rebase","merge-conflict"],"backgroundTag":"git-rebase-conflict","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}