{"record":{"id":"9fa18d169e26d251","repo":"gitbutlerapp/gitbutler","slug":"conflicted-uncommitted-files-can-only-be-marked-as","errorCode":null,"errorMessage":"Conflicted uncommitted files can only be marked as resolved: `but resolve <path>...`","messagePattern":"Conflicted uncommitted files can only be marked as resolved: `but resolve <path>\\.\\.\\.`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":48,"sourceCode":"    ai: bool,\n) -> Result<()> {\n    // Conflicted uncommitted files are marked resolved; anything else is a commit.\n    let conflicted_paths = if targets.is_empty() {\n        Vec::new()\n    } else {\n        conflicted_worktree_paths(ctx)?\n    };\n    let commit_id = match targets.as_slice() {\n        [] => None,\n        [target] if !conflicted_paths.contains(target) => Some(target.clone()),\n        _ => {\n            if let Some(other) = targets.iter().find(|t| !conflicted_paths.contains(t)) {\n                bail!(\n                    \"'{other}' is not a conflicted uncommitted file; `but resolve` takes either one commit or only conflicted files (see `but status`).\"\n                );\n            }\n            if ai {\n                bail!(\n                    \"Conflicted uncommitted files can only be marked as resolved: `but resolve <path>...`\"\n                );\n            }\n            return mark_worktree_conflicts_resolved(ctx, out, targets);\n        }\n    };\n    if ai {\n        if cmd.is_some() {\n            bail!(\n                \"--ai cannot be combined with a resolve subcommand. For one conflict, use `but resolve apply <path>[:<N>] --ai` instead.\"\n            );\n        }\n        return resolve_with_ai(ctx, out, commit_id.as_deref());\n    }\n    match cmd {\n        Some(Subcommands::Conflicts { commit }) => list_conflicts(ctx, out, commit.as_deref()),\n        Some(Subcommands::Apply {\n            target,","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/resolve.rs#L30-L66","documentation":"AI resolution (`--ai`) works on commit conflicts only. When the targets are conflicted uncommitted files (worktree conflicts), `but resolve` can only mark them as resolved — you edit the content yourself — so combining those paths with `--ai` bails with this guidance (resolve.rs:45-51).","triggerScenarios":"`but resolve --ai <conflicted-file-path>...` — the global AI flag together with worktree-conflict paths instead of a single commit ID.","commonSituations":"Assuming `--ai` applies to merge-conflict markers in uncommitted files; re-running an old command line after the conflict moved from a commit into the worktree.","solutions":["Drop `--ai`: edit the files, then `but resolve <path>...` to mark them resolved.","If the conflicts belong to a commit, target the commit instead: `but resolve --ai <commit-id>`.","For a single conflict inside a commit, use `but resolve apply <path>[:<N>] --ai`."],"exampleFix":"# before\nbut resolve --ai src/lib.rs   # uncommitted conflict -> can only be marked resolved\n\n# after\nbut resolve src/lib.rs         # mark resolved after editing the file\nbut resolve --ai 4z            # AI-resolve a conflicted commit","handlingStrategy":"validation","validationCode":"# --ai only for commit targets; if your target is listed as a conflicted file, do not pass --ai\nbut resolve conflicts","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve `--ai` for commit targets; uncommitted conflicts follow the edit-then-mark flow.","Check `but resolve conflicts`: paths listed there take the non-AI flow."],"tags":["cli","resolve","ai","flag-combination","gitbutler"],"backgroundTag":"unsupported-flag-combination","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}