{"record":{"id":"244f4feebc1445ce","repo":"gitbutlerapp/gitbutler","slug":"commit-commit-ref-is-not-in-a-conflicted-state","errorCode":null,"errorMessage":"Commit {commit_ref} is not in a conflicted state. Only conflicted commits can be resolved.","messagePattern":"Commit (.+?) is not in a conflicted state\\. Only conflicted commits can be resolved\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":207,"sourceCode":"        }\n        _ => bail!(\"'{commit_id_str}' does not refer to a commit\"),\n    }\n}\n\nfn enter_resolution(ctx: &mut Context, out: &mut OutputChannel, commit_id_str: &str) -> Result<()> {\n    let t = theme::get();\n    use gix::{prelude::ObjectIdExt as _, revision::walk::Sorting};\n\n    let (commit_gix_oid, commit_ref) = parse_commit_id(ctx, commit_id_str)?;\n\n    // Get the commit and check if it's conflicted\n    let repo = ctx.repo.get()?;\n    let commit = repo\n        .find_commit(commit_gix_oid)\n        .context(\"Failed to find commit\")?;\n\n    if !commit.is_conflicted() {\n        bail!(\n            \"Commit {commit_ref} is not in a conflicted state. Only conflicted commits can be resolved.\"\n        );\n    }\n\n    // Find which stack this commit belongs to\n    let stacks = crate::legacy::workspace::applied_stacks(ctx)?;\n    let mut found_stack_id = None;\n    'outer: for stack in &stacks {\n        // Check if this commit is in any of the stack's heads\n        // TODO(ctx): use `ws` for that.\n        // TODO(perf): This is likely to walk the whole graph.\n        for head in &stack.branches {\n            // Walk the commit history to see if our commit is in this stack\n            let traversal = head\n                .tip\n                .attach(&repo)\n                .ancestors()\n                .sorting(Sorting::BreadthFirst)","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/resolve.rs#L189-L225","documentation":"Thrown by `but resolve <commit>` when entering resolution (edit) mode for a commit that is not marked conflicted. After resolving the id via IdMap, the command loads the commit with repo.find_commit() and checks commit.is_conflicted(); only conflicted commits (e.g. produced by a GitButler rebase/update that hit conflicts) may enter resolution mode.","triggerScenarios":"Running `but resolve <commit-id>` (or a subcommand that starts edit mode) where the target commit is a normal commit, or a commit whose conflicts were already resolved by a previous run/rebase, so is_conflicted() returns false.","commonSituations":"Pointing at a commit oid from an older workspace state after conflicts were already fixed; passing a branch-tip or regular commit instead of the conflicted commit; re-running an old command from shell history after the workspace moved on.","solutions":["Run `but resolve conflicts` (or `but status`) to list the commits that are actually conflicted right now and copy the current id","If the commit was conflicted earlier but is fine now, nothing to do — conflicts were already resolved","If you expected conflicts, run `but update`/the operation that produces conflicts again and re-list"],"exampleFix":"// before\nbut resolve 4a9c1f2\n// error: Commit 4a9c1f2 is not in a conflicted state...\n\n// after\nbut resolve conflicts   # list current conflicted commits\nbut resolve <id-from-list>","handlingStrategy":"validation","validationCode":"# list commits that are actually conflicted before targeting one\nbut resolve conflicts > /tmp/conflicts.txt\ngrep -q . /tmp/conflicts.txt || { echo 'nothing conflicted'; exit 0; }\n# then pass an id from that listing to `but resolve <id>`","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always source commit ids from `but resolve conflicts`, never from memory or history","Treat 'not in a conflicted state' as informational — verify with the listing before retrying","Remember resolutions rewrite descendant ids; stale ids go stale fast"],"tags":["gitbutler","conflict-resolution","precondition"],"backgroundTag":"invalid-workflow-state","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}