rebase-main

Rebase the current branch onto origin/main after conflict resolution.

9|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/gewoonseba/dotfiles --skill rebase-main-gewoonseba
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rebase-main
Source: https://github.com/gewoonseba/dotfiles/tree/main/claude/.claude/skills/rebase-main
Command: npx skills add https://github.com/gewoonseba/dotfiles --skill rebase-main-gewoonseba

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rebase on Main updates the current branch by replaying its commits onto the latest origin/main, helping maintain a clean, linear history and reducing merge complexity.

Core Features & Use Cases

  • Rebase the current branch onto origin/main to incorporate the latest changes.
  • Detect and guide through conflicts, offering steps to resolve them and continue the rebase.
  • Validate the rebase and push updates to the remote with safety checks (e.g., force-with-lease) after a successful rebase.

Quick Start

Rebase the current branch onto origin/main and push the updated history after resolving any conflicts.

Frequently Asked Questions about rebase-main

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

FAQPage Schema
How do I rebase my feature branch onto the latest origin/main?

To rebase a feature branch onto the latest origin/main, the process fetches origin main, replays your branch commits onto it, and guides you through any conflict resolution before pushing the updated linear history.

What happens to uncommitted changes when I start a git rebase on main?

When starting a git rebase on main with uncommitted changes, the workflow automatically stashes your local modifications, performs the rebase onto origin/main, and then reapplies the stashed changes to keep your working directory intact.

How do I resolve conflicts during a git rebase onto main?

To resolve conflicts during a git rebase onto main, the workflow detects the conflicting commits, provides steps to fix them, and continues the rebase sequence until all your branch commits are successfully replayed onto the updated origin/main.

Can I use force-with-lease to push a branch after rebasing onto origin/main?

Yes, you can use force-with-lease to push a branch after rebasing onto origin/main, which validates the rebase success first and then safely pushes your rewritten history to the remote without overwriting unexpected remote changes.

What is the best way to keep a feature branch up to date with main?

The best way to keep a feature branch up to date with main is to rebase it onto the latest origin/main, which replays your commits onto the newest changes and maintains a clean, linear history while reducing merge complexity.

When should I avoid rebasing my branch onto origin/main?

You should avoid rebasing your branch onto origin/main if it is a shared branch with multiple collaborators, because replaying commits rewrites history and requires a force push, which can disrupt other developers' local repositories.