git-rebase

Create timestamped backup branches and validate git rebase operations.

4|Updated Sep 25, 2025
One-click install
npx skills add https://github.com/cowwoc/styler --skill git-rebase
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-rebase
Source: https://github.com/cowwoc/styler/tree/main/.claude/skills/git-rebase
Command: npx skills add https://github.com/cowwoc/styler --skill git-rebase

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git.

What problem does it solves? Manipulating Git history (reordering commits, squashing multiple entries, or updating a branch's base) can be complex and risky. Mistakes can lead to lost commits, a corrupted repository state, or a messy history that hinders collaboration. This Skill provides a guided, safe process to perform these advanced Git operations.

Core Features & Use Cases

  • Automated Backup: Creates a mandatory timestamped backup branch before any rebase operation, ensuring a safe rollback point if anything goes wrong.
  • Commit Reordering & Squashing: Facilitates interactive rebase to change commit order or combine multiple commits into a single, clean entry.
  • Branch Update: Safely rebases feature branches onto the latest main, keeping history linear and up-to-date without manual conflict resolution.
  • Use Case: You have several small, iterative commits on your feature branch that you want to combine into one logical commit before merging to main. This Skill guides you through the process, ensures a backup is made, and validates the outcome, preventing accidental data loss and ensuring a clean history.

Quick Start

Use the git-rebase skill to interactively rebase the current branch onto 'main', squashing the last 3 commits.

Frequently Asked Questions about git-rebase

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

FAQPage Schema
How do I safely rebase and squash commits in Git?

Git rebase safely reorganizes and combines commits by creating an automated backup branch before any changes, then guiding you through interactive rebase to squash multiple commits into one logical entry. The backup ensures you can rollback if needed.

What's the best way to clean up Git history before merging a feature branch?

Rebase your feature branch onto main while squashing related commits into clean, logical units. This flattens iterative changes into meaningful history, making the merge cleaner and easier to review without creating multiple small commits.

Can I reorder Git commits without losing work?

Yes, interactive rebase lets you reorder commits safely. This Skill enforces mandatory backup creation and validates the result afterward, preventing accidental data loss while you rearrange commit sequence.

How do I update my feature branch against the latest main?

Rebase your branch onto main to apply your commits on top of the latest changes, keeping history linear. This avoids merge commits and ensures your feature integrates cleanly with recent main updates.

What precautions should I take before rebasing Git history?

Ensure your working directory is clean before rebasing. This Skill enforces a clean state requirement and creates timestamped backup branches automatically, so you have a recovery point if the rebase encounters conflicts or errors.

When should I avoid rebasing in Git?

Avoid rebasing commits already pushed to shared branches where others depend on them, as it rewrites history and breaks downstream work. Use rebase only on local feature branches or branches where the team expects history cleanup before merge.