{"record":{"id":"d25fd66686c3606c","repo":"gitbutlerapp/gitbutler","slug":"cannot-land-branch-name-merging-into-fetch-rem","errorCode":null,"errorMessage":"Cannot land {branch_name}: merging into {fetch_remote_name}/{target_branch_name} resulted in conflicts.{detail} Rebase {branch_name} onto the target and resolve, then re-run `but land {branch_name}`.","messagePattern":"Cannot land (.+?): merging into (.+?)/(.+?) resulted in conflicts\\.(.+?) Rebase (.+?) onto the target and resolve, then re-run `but land (.+?)`\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-api/src/land/merge.rs","lineNumber":102,"sourceCode":"    let mut merge = repo.merge_trees(\n        base_tree,\n        our_tree,\n        their_tree,\n        repo.default_merge_labels(),\n        merge_options,\n    )?;\n    if merge.has_unresolved_conflicts(unresolved) {\n        let paths: Vec<String> = merge\n            .conflicts\n            .iter()\n            .filter_map(|c| c.ours.location().to_str().ok().map(ToOwned::to_owned))\n            .collect();\n        let detail = if paths.is_empty() {\n            String::new()\n        } else {\n            format!(\" Conflicting paths: {}.\", paths.join(\", \"))\n        };\n        bail!(\n            \"Cannot land {branch_name}: merging into {fetch_remote_name}/{target_branch_name} \\\n             resulted in conflicts.{detail} Rebase {branch_name} onto the target and resolve, then \\\n             re-run `but land {branch_name}`.\"\n        );\n    }\n    let merged_tree = merge.tree.write()?.detach();\n\n    // Build the 2-parent merge commit. Parent order is `[target, feature]` so `--first-parent`\n    // mainline walks stay correct. `commit_signatures()` honors `gitbutler.gitbutlerCommitter`.\n    let (author, committer) = repo.commit_signatures()?;\n    let mut commit = gix::objs::Commit {\n        tree: merged_tree,\n        parents: [target_oid, feature_oid].into_iter().collect(),\n        author,\n        committer,\n        encoding: None,\n        message: format!(\"Merge branch '{branch_name}'\").into(),\n        extra_headers: Vec::new(),","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-api/src/land/merge.rs#L84-L120","documentation":"Error \"Cannot land {branch_name}: merging into {fetch_remote_name}/{target_branch_name} resulted in conflicts.{detail} Rebase {branch_name} onto the target and resolve, then re-run `but land {branch_name}`.\" thrown in gitbutlerapp/gitbutler.","triggerScenarios":"Thrown at crates/but-api/src/land/merge.rs:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}