Rebase branch with intelligent conflict resolution and force push
Rebase current branch onto base branch with smart conflict resolution.
main or mastergit fetch origin <base>
git rebase origin/<base>
Lockfile conflicts are resolved by reinstalling:
git checkout --theirs <lockfile>package-lock.json → npm installyarn.lock → yarn installpnpm-lock.yaml → pnpm installgit add <lockfile> && git rebase --continueAuto-resolve cases:
Ask user cases:
Conflict detected
├─ Lockfile only → auto reinstall → continue
├─ Code (simple) → Claude merges both sides → continue
├─ Code (complex) → show conflict, ask user
└─ Mixed → resolve lockfile first, then code
--forcegit fetch origin to get latestgit rebase origin/<base>git rebase --continuegit push --force-with-leaseClean rebase:
/stylish-git:rebase
→ Current branch: feature/add-button
→ Fetching origin/main...
→ Rebasing onto origin/main...
→ No conflicts ✅
→ Pushing with --force-with-lease...
→ Done ✅
Lockfile conflict:
/stylish-git:rebase
→ Rebasing onto origin/main...
→ Conflict: package-lock.json (lockfile)
→ Auto-resolving: npm install...
→ Continuing rebase...
→ Done ✅
Code conflict (auto-resolved):
/stylish-git:rebase
→ Conflict: src/utils.ts
→ Analyzing... both sides add different imports
→ Merging: keeping all imports
→ Continuing rebase...
→ Done ✅
Code conflict (needs input):
/stylish-git:rebase
→ Conflict: src/api.ts
→ Same function modified differently on both sides
→ Showing both versions...
→ Which version to keep? (ours/theirs/manual)
Protected branch error:
/stylish-git:rebase
→ Error: Cannot rebase on protected branch 'main'
→ Switch to a feature branch first