Skip to content

feat: configurable conflict resolver for rebase conflicts#146

Open
abersnaze wants to merge 2 commits intomsiemens:masterfrom
abersnaze:conflict-resolver
Open

feat: configurable conflict resolver for rebase conflicts#146
abersnaze wants to merge 2 commits intomsiemens:masterfrom
abersnaze:conflict-resolver

Conversation

@abersnaze
Copy link
Copy Markdown

Summary

  • Adds a new git-up.rebase.conflict-resolver config setting that specifies a command to invoke when rebase conflicts occur
  • git-up builds a default prompt with full context (branch names, conflicted files, resolution steps) and substitutes it into the command's {prompt} placeholder
  • If the resolver succeeds, git-up continues to the next branch; if it fails, the repo is left in the conflicted state for manual resolution

Usage

git config git-up.rebase.conflict-resolver "claude -p {prompt}"
# or
git config git-up.rebase.conflict-resolver "aider --message {prompt}"

Changes

  • git_wrapper.py: Added suppress_pop flag to stasher() to prevent auto-unstash when leaving conflicted state; added UnresolvedConflictError exception
  • gitup.py: New setting, _build_resolver_prompt(), _try_resolve_conflicts(), and integration into the rebase path
  • tests/test_conflict_resolver.py: 4 tests covering resolver success, failure, no-resolver fallback, and prompt content

Test plan

  • python -m pytest PyGitUp/tests/test_conflict_resolver.py -xvs — all 4 new tests pass
  • python -m pytest PyGitUp/tests/ -x — full suite (40 tests) passes with no regressions
  • Manual: configure git-up.rebase.conflict-resolver, create a conflict, verify git up invokes the resolver

🤖 Generated with Claude Code

abersnaze and others added 2 commits April 13, 2026 12:14
When `git up` encounters a rebase conflict, it can now invoke a
configurable command to resolve it automatically. Configure via:

  git config git-up.rebase.conflict-resolver "claude -p {prompt}"

git-up builds a rich default prompt with branch names, conflicted
files, and resolution steps, then substitutes it into the {prompt}
placeholder. Environment variables GITUP_BRANCH, GITUP_TARGET, and
GITUP_REPO_PATH are also set.

If the resolver succeeds (exit 0 and rebase completed), git-up
continues to the next branch. If it fails, the repo is left in the
conflicted state for manual resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant