{"record":{"id":"c6ee69404c147cdf","repo":"gitbutlerapp/gitbutler","slug":"identifier-branch-id-matches-multiple-non-bran","errorCode":null,"errorMessage":"Identifier '{branch_id}' matches multiple non-branch items. Please use a branch name or branch CLI ID.","messagePattern":"Identifier '(.+?)' matches multiple non-branch items\\. Please use a branch name or branch CLI ID\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/push.rs","lineNumber":1135,"sourceCode":"    }\n\n    if cli_ids.len() > 1 {\n        let branch_names: Vec<String> = cli_ids\n            .iter()\n            .filter_map(|id| match id {\n                CliId::Branch(branch) => Some(branch.name.clone()),\n                _ => None,\n            })\n            .collect();\n\n        if !branch_names.is_empty() {\n            return Err(anyhow::anyhow!(\n                \"Ambiguous branch identifier '{}'. Did you mean one of:\\n{}\",\n                branch_id,\n                format_branch_suggestions(&branch_names)\n            ));\n        } else {\n            return Err(anyhow::anyhow!(\n                \"Identifier '{branch_id}' matches multiple non-branch items. Please use a branch name or branch CLI ID.\"\n            ));\n        }\n    }\n\n    match &cli_ids[0] {\n        CliId::Branch(branch) => Ok(branch.name.clone()),\n        _ => Err(anyhow::anyhow!(\n            \"Expected branch identifier, got {}. Please use a branch name or branch CLI ID.\",\n            cli_ids[0].kind_for_humans()\n        )),\n    }\n}\n\nfn get_available_branch_names(ctx: &Context) -> anyhow::Result<Vec<String>> {\n    let stacks = crate::legacy::workspace::applied_stacks(ctx)?;\n    let mut branch_names = Vec::new();\n","sourceCodeStart":1117,"sourceCodeEnd":1153,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/push.rs#L1117-L1153","documentation":"The argument matched multiple entries in the IdMap but none of them are branches (commits, reviews, other id kinds), so the branch suggestion list cannot even be built. The generic message asks for a branch name or a branch CLI id instead.","triggerScenarios":"Passing a short prefix that matches several non-branch items, e.g. `but push 4a2f` where multiple commits or reviews share the prefix.","commonSituations":"Short SHA prefixes colliding in busy workspaces; ids copied from `but oplog` or review output mistaken for branch ids.","solutions":["Pass a branch name or a branch CLI id instead of a commit/review prefix","Use a longer prefix or the exact id of the intended item","List current branch names and ids with `but status`"],"exampleFix":"# before\nbut push 4a2f\n# error: Identifier '4a2f' matches multiple non-branch items...\n\n# after\nbut push feature-x   # a branch name or branch CLI id","handlingStrategy":"validation","validationCode":"# Use branch names (or branch CLI ids) rather than commit/review prefixes\n# verify the kind before scripting: ids shown by `but status` for branches\nbut status","typeGuard":null,"tryCatchPattern":"let err = String::from_utf8_lossy(&out.stderr).to_string();\nif err.contains(\"matches multiple non-branch items\") {\n    // ask for a branch name or branch CLI id and retry\n}","preventionTips":["Know the id kind you are passing: branch ids come from `but status`","Do not reuse commit or oplog prefixes as push targets","Lengthen prefixes when a collision is possible"],"tags":["push","branch-resolution","ambiguous-id","cli-id"],"backgroundTag":"ambiguous-identifier","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}