skills/rebase/SKILL.md
Rebase current work branch on latest main with intelligent conflict resolution.
npx skillsauth add acartine/osterman rebaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Automates rebasing the current work branch on the latest main, including intelligent conflict resolution and safe force pushing.
# Store current branch
WORK_BRANCH=$(git branch --show-current)
# Validate not on main
if [ "$WORK_BRANCH" == "main" ]; then
echo "Error: Cannot rebase main onto itself"
exit 1
fi
# Update main
git checkout main
git pull
# Return to work branch and rebase
git checkout $WORK_BRANCH
git rebase main
# Handle conflicts if they occur (see conflict resolution strategy below)
# Force push with lease (safer than --force)
git push --force-with-lease origin $WORK_BRANCH
When conflicts occur during rebase:
List conflicted files: git diff --name-only --diff-filter=U
For each conflicted file, analyze and resolve:
Resolution commands:
# Accept incoming (main) changes
git checkout --theirs <file>
# Accept current (work branch) changes
git checkout --ours <file>
# Manual merge (for complex cases)
# Edit file directly to resolve conflicts
# Stage resolved file
git add <file>
Continue rebase: git rebase --continue
Repeat until complete
Always report:
git log --oneline main..HEADgit rebase --abortIf automatic conflict resolution fails:
git rebase --abort
Then report to user with suggestion to resolve manually via git rebase -i main
--force-with-lease)devops
Execute Terraform plan and produce a risk summary; never apply.
development
Verify main branch stability before development and before pushing code to remote.
testing
Checkout main branch and pull latest changes from remote.
tools
Analyze PRs and issues to provide context orientation and actionable next steps.