rebase
SKILL.md
Rebase onto Main
Rebase the current branch onto the latest main branch, resolving conflicts by preferring upstream changes.
Setup
Determine the repository for all gh commands:
REPO=$(./scripts/agents/tooling/agentTool.ts getRepo)
Always pass -R "$REPO" to gh commands.
Workflow
-
Fetch latest changes:
git fetch origin main >/dev/null -
Start rebase with upstream preference:
git rebase -X theirs origin/main >/dev/nullThe
-X theirsstrategy resolves conflicts by preferring the upstream (main) version. -
If rebase fails (conflicts that can't be auto-resolved):
-
Check
git statusto see conflicting files -
For each conflict, accept the upstream version:
git checkout --theirs <file> git add <file> -
Continue the rebase:
git rebase --continue -
Repeat until rebase completes
-
-
Force push the rebased branch:
git push --force-with-lease >/dev/null
Notes
- This skill prefers upstream (main) changes when conflicts occur
- Use this when you want to update your branch and don't mind losing local changes that conflict
- The
--force-with-leaseflag is safer than--forceas it won't overwrite remote changes you haven't seen - Always suppress stdout on git push to save tokens
Weekly Installs
2
Repository
a2f0/tearleadsFirst Seen
Feb 26, 2026
Security Audits
Installed on
amp2
cline2
opencode2
cursor2
kimi-cli2
codex2