# Rebase Conflict Handling

## Handle Rebase Conflicts

```bash
# If rebase has conflicts
if [ -d ".git/rebase-merge" ] || [ -d ".git/rebase-apply" ]; then
  echo "⚠️ REBASE CONFLICT DETECTED"

  CONFLICTS=$(git diff --name-only --diff-filter=U)
  echo "Conflicting files:"
  echo "$CONFLICTS"

  # Check for migration conflicts
  MIGRATION_CONFLICTS=$(echo "$CONFLICTS" | grep "Migrations/")
  [ -n "$MIGRATION_CONFLICTS" ] && {
    echo "⚠️ Migration conflicts detected!"
    echo "Recommend: /efcore rebase-snapshot"
  }

  # Options
  AskUserQuestion:
    header: "Conflict"
    question: "How to handle conflicts?"
    options:
      - label: "Resolve manually"
        description: "I'll fix conflicts and continue"
      - label: "Abort rebase"
        description: "Cancel and return to previous state"
      - label: "Accept theirs (migrations)"
        description: "Use base branch migrations, regenerate ours"
fi
```

**User actions:**
- **Resolve manually**: Fix conflicts in editor, then `git rebase --continue`
- **Abort rebase**: `git rebase --abort`
- **Accept theirs**: `git checkout --theirs -- {files}`, then `git rebase --continue`
