{"record":{"id":"641d39e53a89dfca","repo":"gitbutlerapp/gitbutler","slug":"failed-to-merge-bases-while-cherry-picking-commit-target","errorCode":null,"errorMessage":"Failed to merge bases while cherry picking commit {target}. Encountered a conflict while merging the commit's original bases/new bases.","messagePattern":"Failed to merge bases while cherry picking commit (.+?)\\. Encountered a conflict while merging the commit's original bases/new bases\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-rebase/src/graph_rebase/rebase.rs","lineNumber":98,"sourceCode":"                        | CherryPickOutcome::Identity(new_id) => {\n                            let mut new_pick = pick.clone();\n                            new_pick.id = new_id;\n                            let new_idx = output_graph.add_node(Step::Pick(new_pick));\n                            graph_mapping.insert(step_idx, new_idx);\n                            if !pick.exclude_from_tracking {\n                                history.update_mapping(pick.id, new_id);\n                            }\n\n                            new_idx\n                        }\n                        CherryPickOutcome::FailedToMergeBases {\n                            base_merge_failed,\n                            bases,\n                            onto_merge_failed,\n                            ontos,\n                        } => {\n                            // Exit early - the rebase failed because it encountered a commit it couldn't pick\n                            bail!(format_base_merge_error(\n                                pick.id,\n                                base_merge_failed,\n                                bases,\n                                onto_merge_failed,\n                                ontos\n                            ));\n                        }\n                    }\n                }\n                Step::Reference { refname, mutable } => {\n                    // Immutable references are kept in the graph for traversal\n                    // but never moved, created, or deleted.\n                    if mutable {\n                        let graph_parents = collect_ordered_parents(&self.graph, step_idx);\n                        let first_parent_idx = graph_parents\n                            .first()\n                            .context(\"References should have at least one parent\")?;\n                        let Some(new_idx) = graph_mapping.get(first_parent_idx) else {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-rebase/src/graph_rebase/rebase.rs#L80-L116","documentation":"Cherry-picking a commit requires merging its original merge bases (and 'onto' bases) into the new graph. This error is raised via format_base_merge_error when one of those base merges conflicted, meaning the commit could not be transplanted onto its new parent. The rebase aborts early with a formatted diagnostic describing which merge failed.","triggerScenarios":"Calling rebase where a Pick step's original base(s) or onto base(s) fail to merge (base_merge_failed or onto_merge_failed set in the CherryPickOutcome::MergeBaseFailed variant).","commonSituations":"Deeply diverged histories; commits whose parents were rewritten externally (e.g. force-push, filter-repo) so original bases no longer merge; move/absorb operations on heavily edited stacks.","solutions":["Read the formatted error's base_merge_failed/onto_merge_failed detail to identify which commit failed.","Manually rebase or re-create the failing commit onto the target base, then retry the rebase.","Reduce the divergence: rebase the source branch onto the target first, or split the stack into smaller rebases."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match rebase_result {\n    Err(e) if e.to_string().contains(\"Failed to merge bases while cherry picking\") => {\n        // parse formatted detail, re-create failing commit manually, then retry\n    }\n    other => other?,\n}","preventionTips":["Keep stacks small and rebased frequently to limit divergence","Avoid external history rewrites (force-push/filter-repo) under rebased branches","Pre-fetch and integrate upstream before running moves/absorbs"],"tags":["rebase","merge-conflict","cherry-pick"],"backgroundTag":"git-command-failed","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}