git-rebase

Resolve git rebase conflicts while preserving branch changes.

Updated May 28, 2026
One-click install
npx skills add https://github.com/haryelramalho/skills --skill git-rebase-haryelramalho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-rebase
Source: https://github.com/haryelramalho/skills/tree/main/skills/curated/git-rebase
Command: npx skills add https://github.com/haryelramalho/skills --skill git-rebase-haryelramalho

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you rebase branches without losing work, turning conflict-heavy history cleanup into a controlled, recoverable process.

Core Features & Use Cases

  • Conflict-Aware Rebasing: Choose between squash-first, interactive, or simple rebase strategies based on commit count and merge complexity.
  • Safe Recovery: Create backup branches before rebasing, inspect conflicted files, and recover quickly if something goes wrong.
  • Validation and Resolution: Use bundled scripts and heuristics to analyze conflicts, verify clean merges, and confirm the code is ready for tests and force-pushes.
  • Use Case: A feature branch has drifted far from main and now conflicts across multiple commits; this Skill guides the rebase, resolution, validation, and safe push back to the remote.

Quick Start

Use this skill to safely rebase your current feature branch onto the latest main branch while preserving your changes and resolving conflicts with confidence.

Frequently Asked Questions about git-rebase

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

FAQPage Schema
How do I resolve git rebase conflicts without losing my branch changes?

To resolve git rebase conflicts safely, you can create backup branches before rebasing and use validation heuristics to analyze conflicted files. This preserves your feature branch changes while ensuring a clean linear history.

What is the best way to rebase a feature branch that has drifted far from main?

The best way to rebase a drifted feature branch is choosing between squash-first, interactive, or simple rebase strategies based on commit count. This manages multi-commit history cleanup and resolves repeated conflicts on collaborative codebases.

How does git rebase compare to git merge for maintaining a clean linear history?

Git rebase replays your commits onto the target branch for a linear history, whereas merge creates a merge commit. Using rebase with validation checks and backup branches prevents losing work during complex conflict resolution.

Can I safely force-push after cleaning up multiple commits during an interactive rebase?

Yes, you can safely force-push after an interactive rebase by running validation checks to verify clean merges. Safe force-push guidance ensures your cleaned multi-commit history updates the remote without overwriting remote changes.

What should I do when git rebase conflicts keep repeating across multiple commits?

When git rebase conflicts repeat across multiple commits, use conflict analysis heuristics and bundled scripts to inspect conflicted files. Backup branch creation allows quick recovery if the repeated resolution attempts fail.

When do I need to create a backup branch before rebasing my feature branch?

You need to create a backup branch before rebasing when your feature branch has drifted far from main and faces complex merge conflicts. This safe recovery step ensures you can quickly recover if the rebase fails.