SKILL.md
Rebase
Rebase the current branch.
Arguments
- No arguments: rebase on local main
origin: fetch origin, rebase on origin/mainorigin/branch: fetch origin, rebase on origin/branchbranch: rebase on local branch
Steps
- Parse arguments
- No args → target is "main", no fetch - Contains "/" (e.g., "origin/develop") → split into remote and branch, fetch remote, target is remote/branch - Just "origin" → fetch origin, target is "origin/main" - Anything else → target is that branch name, no fetch
- Fetch if needed
``bash git fetch <remote> ``
- Rebase
``bash git rebase <target> ``
- Handle conflicts (if any)
- Continue until complete
Handling Conflicts
- BEFORE resolving any conflict, understand changes made to each conflicting file in the target branch
- For each conflicting file:
``bash git log -p -n 3 <target> -- <file> ``
- Goal: preserve BOTH target branch changes AND our branch's changes
- After resolving each conflict:
``bash git add <file> git rebase --continue ``
- If a conflict is too complex or unclear, ask for guidance before proceeding