Skip to content

CLI: but resolve finish fails with config access error in edit mode #12312

@sdrshn-nmbr

Description

@sdrshn-nmbr

Issue: but resolve finish fails with "No default target branch set" after resolving conflicts

Summary

When resolving conflicts in a stacked branch using but resolve, the but resolve finish command fails even after all conflict markers are resolved and files are staged.

Steps to Reproduce

  1. Create/work on a stacked branch with multiple conflicted commits
  2. Enter resolve mode: but resolve <commit-id>
  3. Manually resolve all conflict markers in files
  4. Stage resolved files: git add <files>
  5. Verify all conflicts resolved: git status shows no unmerged files
  6. Attempt to finish: but resolve finish

Expected Behavior

but resolve finish should complete the conflict resolution and commit the changes (as documented for UI "Save and Exit" behavior).

Actual Behavior

Error: Setup required: No default target branch set.

Environment

  • GitButler Version: 0.19.1
  • OS: macOS
  • Git: Yes, repo has valid remote origin/dev

Proof of Configuration

$ cat .git/gitbutler/virtual_branches.toml | grep -A 6 '\[default_target\]'
[default_target]
branchName = "dev"
remoteName = "origin"
remoteUrl = "https://github.com/<example>"
sha = "f33f1c373023debd22a70022b3a5dac0b6e1a9d2"
pushRemoteName = "origin"

$ git rev-parse origin/dev
f33f1c373023debd22a70022b3a5dac0b6e1a9d2  # ✅ Valid and reachable

Root Cause Analysis

The CLI appears to fail reading the default target configuration from .git/gitbutler/virtual_branches.toml when in gitbutler/edit branch context. The configuration exists and is valid, but the but resolve finish command cannot access it.

Workaround

Use GitButler GUI to exit resolve mode: click "Save changes and exit" button instead of CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions