GitButler ⧓

Commands
>_

but resolve

Resolve conflicts in a commit or in uncommitted files.

When a commit is in a conflicted state (marked with conflicts during rebase), use this command to enter resolution mode, resolve the conflicts, and finalize. Uncommitted files marked {conflicted} by but status are resolved with but resolve <path>... once they hold the desired content (or were deleted).

Workflow

  1. Enter resolution mode: but resolve <commit-id>
  2. Resolve conflicts in your editor (remove conflict markers)
  3. Check remaining conflicts: but resolve status
  4. Finalize resolution: but resolve finish Or cancel: but resolve cancel

Alternatively, resolve with AI in one step: but resolve <commit-id> --ai, or but resolve --ai to resolve all conflicted commits, oldest first.

When in resolution mode, but status will also show that you're resolving conflicts.

Usage: but resolve <COMMAND> [TARGETS] [OPTIONS]

Subcommands

but resolve conflicts

List the conflicts of a conflicted commit, without entering resolution mode.

Each conflict is shown with its ours side (the new base the commit was rebased onto), the common ancestor, and its theirs side (the commit's own version), numbered per file for use with but resolve apply.

Usage: but resolve conflicts [COMMIT]

Arguments:

  • <COMMIT> — A conflicted commit, or a branch (meaning its oldest conflicted commit). Defaults to the first conflicted branch's oldest conflicted commit

but resolve apply

Resolve conflicts of a conflicted commit, without entering resolution mode.

Targets one conflict (<path>:<N>, numbers from but resolve conflicts) or every conflict in a file (<path> with --ours/--theirs). The replacement content for mixed resolutions is read from --file or stdin. Resolving only some conflicts keeps the commit conflicted with the rest, so conflicts can be worked off incrementally; the commit id changes with every apply. Undo with but undo.

Usage: but resolve apply <TARGET> [OPTIONS]

Arguments:

  • <TARGET> — The conflicted file, optionally with a 1-based conflict number (<path>:<N>) (required)

Options:

  • --commit <COMMIT> — A conflicted commit, or a branch (meaning its oldest conflicted commit — branch names stay stable across applies, unlike commit ids). Defaults to the first conflicted branch's oldest conflicted commit
  • --ours — Take the ours side: the new base the commit was rebased onto
  • --theirs — Take the theirs side: the commit's own version
  • --ai — Let the configured AI model merge the targeted conflicts
  • -F, --file <FILE> — Read the replacement content from this file (otherwise from stdin)

but resolve status

Show the status of conflict resolution, listing remaining conflicted files.

Usage: but resolve status

but resolve finish

Finalize conflict resolution and return to workspace mode.

This commits the resolved changes, rebases any commits on top of the resolved commit, and returns to the normal workspace.

Usage: but resolve finish

but resolve cancel

Cancel conflict resolution and return to workspace mode.

This discards all changes made during resolution and restores the workspace to its pre-resolution state.

Usage: but resolve cancel [OPTIONS]

Options:

  • -f, --force — Forcibly remove any changes made

Options

  • --ai — Resolve the conflicts with the configured AI model and apply the result.

With a commit ID this resolves only that commit; without one it resolves all conflicted commits in the workspace, oldest first. Undo the result with but undo.

Last updated on

On this page

Edit on GitHubGive us feedback