{"record":{"id":"69257c324d0ab0d8","repo":"gitbutlerapp/gitbutler","slug":"failed-to-push-of-branch","errorCode":null,"errorMessage":"failed to push {} of {} branch{}","messagePattern":"failed to push (.+?) of (.+?) branch(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/push.rs","lineNumber":834,"sourceCode":"                    \"branch\"\n                } else {\n                    \"branches\"\n                }\n            )?;\n            for failed in &failed_branches {\n                writeln!(\n                    human,\n                    \"    {} - {}\",\n                    t.error.paint(&failed.branch_name),\n                    t.hint.paint(&failed.error)\n                )?;\n            }\n        }\n    }\n\n    if !failed_branches.is_empty() {\n        let attempted = failed_branches.len() + pushed_results.len();\n        anyhow::bail!(\n            \"failed to push {} of {} branch{}\",\n            failed_branches.len(),\n            attempted,\n            if attempted == 1 { \"\" } else { \"es\" }\n        );\n    }\n\n    Ok(())\n}\n\nfn handle_no_branch_specified(\n    ctx: &Context,\n    out: &mut OutputChannel,\n) -> anyhow::Result<BranchSelection> {\n    let t = theme::get();\n\n    // Check if we're in an interactive terminal with human output format.\n    // This comes first: push_all_branches computes its own candidates, so","sourceCodeStart":816,"sourceCodeEnd":852,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/push.rs#L816-L852","documentation":"Summary failure raised by push_all_branches after a multi-branch push attempt: some of the attempted branches failed to reach the remote. It aggregates how many of the total branches failed, and the per-branch errors are printed just above in human output. Check the listed branch errors (auth, remote rejection, etc.) and retry the push.","triggerScenarios":"Running `but push --all` (push_all_branches) when one or more branches fail their individual push, e.g. due to remote rejection, conflicts, or upstream errors.","commonSituations":"Remote rejects a non-fast-forward push; network failures mid-push; branches with unmerged or conflicted commits that the upstream refuses.","solutions":["Check the earlier per-branch error output for the root cause of each failed branch","Re-run `but push` for the failed branches individually to see the detailed error","Inspect branch state with `but status` and resolve conflicts before pushing","Retry after network/auth issues are resolved"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let failed: Vec<_> = branches.iter().filter(|b| !pushed.contains(b)).collect();\nif !failed.is_empty() { eprintln!(\"will fail: {:?}\", failed); }","typeGuard":null,"tryCatchPattern":"match push_all_branches(ctx).await {\n    Err(e) if e.to_string().contains(\"failed to push\") => {\n        eprintln!(\"{e:#}; see per-branch output above for root causes\");\n    }\n    Err(e) => return Err(e),\n    Ok(_) => {}\n}","preventionTips":["Resolve all conflicts (but status) before bulk pushing","Push branches individually to isolate failures","Check remote connectivity/auth before `--all` pushes"],"tags":["git","push","cli"],"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"}