rebase

Rebase PR branches onto updated base branches and resolve merge conflicts correctly.

1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/Fidasek009/agents --skill rebase-fidasek009
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rebase
Source: https://github.com/Fidasek009/agents/tree/main/.agents/skills/rebase
Command: npx skills add https://github.com/Fidasek009/agents --skill rebase-fidasek009

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Rebasing a pull request branch onto an updated base branch often produces confusing conflicts, and resolving them incorrectly can silently drop changes or corrupt history. This Skill provides a clear mental model and step-by-step workflow for replaying commits and resolving each conflict with the right intent. ## Core Features & Use Cases - Structured Rebase Workflow: Fetch the latest base, rebase, resolve conflicts file by file, and force-push safely with --force-with-lease. - Conflict Resolution Rules: Decision tables for common cases such as refactored functions, deleted code, nearby additions, and formatting-only conflicts. - Special File Handling: Rules for database migration sequence collisions and auto-generated files like lock files and protobuf outputs. - Use Case: Your PR branch conflicts with main after a teammate merged a refactor. Use this Skill to rebase onto origin/main, apply your logic onto the refactored code, renumber a colliding migration, and push the rewritten history safely. ## Quick Start Rebase my current PR branch onto the latest main branch and help me resolve any conflicts that come up.

Frequently Asked Questions about rebase

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rebase a PR branch onto the latest main branch?▼

Fetch the remote with git fetch origin, then run git rebase origin/main from your PR branch. Resolve each conflict, stage the file with git add, and continue with git rebase --continue until the replay finishes.

How to resolve merge conflicts during a git rebase?▼

During a rebase, 'theirs' is the updated base branch and 'yours' is the commit being replayed. Read both sides, understand what the base changed, then reapply your commit's intent onto the new base code rather than picking one side wholesale.

What should I do when two branches add migrations with the same number?▼

Keep both migration files and renumber your new migration to the next available sequence number. Never edit an existing migration that may already be applied; create a new compensating migration instead.

Should I hand-edit lock files to fix rebase conflicts?▼

No. For auto-generated files like lock files, API clients, or protobuf outputs, accept either side to clear the conflict markers, rerun the project's generator, and then stage the regenerated file with git add.

When is it unsafe to rebase a branch?▼

Never rebase shared branches because rebasing rewrites history; it is only safe on your own PR branch. Also abort with git rebase --abort if a conflict is unclear or you do not understand what the base change did.

Why does git push fail after a rebase and how do I fix it?▼

A rebase rewrites commit history, so a normal push is rejected. Use git push --force-with-lease, which updates the remote safely and fails if the remote has commits you have not fetched yet.