rebase

Replay feature branch commits onto an updated base with conflict resolution.

Updated Dec 21, 2018
One-click install
npx skills add https://github.com/dhnt/dhnt --skill rebase-dhnt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rebase
Source: https://github.com/dhnt/dhnt/tree/main/catalog/md/commit/rebase
Command: npx skills add https://github.com/dhnt/dhnt --skill rebase-dhnt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rebase solves the problem of keeping your branch history clean and up to date when the base branch has advanced, by replaying your work onto the latest base.

Core Features & Use Cases

  • Linear history with upstream updates: Replays your commits onto an updated base (e.g., main) so your changes can be tested against current code.
  • Conflict-aware resolution guidance: Provides steps to resolve merge conflicts deliberately and safely before continuing.
  • Pre-PR hygiene: Supports interactive rebase for squashing and reordering WIP commits into a review-ready commit set, such as condensing many work-in-progress commits into fewer atomic ones for a pull request.

Quick Start

Rebase your feature branch onto the updated main branch and then force-push it safely with --force-with-lease after resolving any conflicts and running the build and tests.

Frequently Asked Questions about rebase

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

FAQPage Schema
How do I rebase my feature branch onto an updated main branch?

To rebase your feature branch, Git replays your commits on top of the updated main branch. This maintains a clean linear history by shifting your work to the latest base before integration.

What is the best way to squash WIP commits before a pull request?

Squashing WIP commits before a pull request uses interactive rebase to condense work-in-progress commits into atomic ones. This creates a review-ready, clean commit set for your pull request.

How does conflict resolution work during a git rebase?

Conflict resolution during a git rebase requires deliberately fixing merge conflicts before continuing. You must resolve conflicting changes safely, then continue replaying your remaining commits onto the base.

Why should I use force-with-lease when pushing a rebased branch?

You should use force-with-lease when pushing a rebased branch to avoid overwriting others' work. It safely updates the remote history only if no upstream changes occurred since your last fetch.

When do I need to rebase instead of merging my git branch?

You need to rebase instead of merging when the base branch has advanced during your work and you require a clean linear history. Replaying commits onto the updated base tests your changes against current code.

Can I rebase a branch without running tests afterward?

You should not rebase a branch without running tests afterward. Replaying commits onto an updated base requires build and test verification to ensure your changes function correctly against the new base code.