| name | rebase |
| description | Rebases the current branch onto the latest main branch. |
Steps:
- Fetch the latest changes from origin.
- Rebase the current branch onto
origin/main.
- If there are conflicts, resolve conflicts automatically, trying to preserve features from both branches.
Conflict resolution
If no conflicts: Report success — how many commits were replayed, new HEAD.
If conflicts occur, handle each one:
- Run
git diff --name-only --diff-filter=U to list conflicted files.
- For each conflicted file, read the file and examine the conflict markers.
- Attempt trivial resolution: if one side is clearly a superset (the other side made no changes in that region), resolve automatically.
- For genuine conflicts, show the user both sides with surrounding context using AskUserQuestion. Offer:
- Keep ours — accept the current branch's version
- Keep theirs — accept the upstream version
- Abort rebase — run
git rebase --abort and stop
- After resolving all files in the current step:
git add <files> and git rebase --continue.
- Repeat until the rebase completes or the user aborts.