git-rebase

Replay commits onto a new base with interactive rebase and autosquash.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/theslashdojo/dojo --skill git-rebase-theslashdojo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-rebase
Source: https://github.com/theslashdojo/dojo/tree/main/nodes/git/rebase
Command: npx skills add https://github.com/theslashdojo/dojo --skill git-rebase-theslashdojo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, and includes scripts (resource) components.

What problem does it solve?

Rewriting messy or divergent commit history into a clean, linear sequence that is easy to review and merge, removing WIP commits and enabling logical commit organization before sharing.

Core Features & Use Cases

  • Interactive rebase to reorder, edit, squash, fixup, or drop commits for tidy history.
  • Autosquash workflow to combine iterative fixup commits automatically before pushing.
  • Transplant commits with --onto to move ranges between bases and recover from wrong branching.
  • Conflict resolution guidance per-commit with continue, skip, and abort patterns and reflog recovery for bad rebases.
  • Use Case: Clean up a feature branch with many WIP commits into a few logical commits and then push safely with force-with-lease.

Quick Start

Use this skill to interactively rebase your feature branch onto main with autosquash and then push using force-with-lease.

Frequently Asked Questions about git-rebase

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

FAQPage Schema
How do I squash WIP commits into logical commits before pushing?

Interactive rebase lets you squash WIP commits by replaying your commits onto a new base, allowing you to reorder, edit, fixup, or drop them into a clean, linear sequence.

How does git rebase --onto work for transplanting commit ranges?

Git rebase --onto transplants a commit range by replaying commits onto a specified new base, allowing you to move ranges between branches and recover from branching onto the wrong base.

What is the safest way to force push after rewriting commit history?

The safest way to force push after rewriting commit history is using force-with-lease, which prevents overwriting remote commits if another contributor has pushed updates to the same branch.

Can I automatically combine fixup commits during interactive rebase?

Yes, you can automatically combine fixup commits during interactive rebase by using the autosquash workflow, which detects and integrates iterative fixup commits sequentially before you push.

How do I resolve per-commit conflicts when rebasing a feature branch?

To resolve per-commit conflicts during rebase, use the continue, skip, and abort patterns to manage each conflict individually, and use reflog recovery to revert bad rebases if needed.

When should I avoid rewriting commit history with git rebase?

You should avoid rewriting commit history with git rebase on shared branches that others have already pulled, because rewriting diverges the history and requires a force push to overwrite remote commits.