rebase-safely

Guides Git rebase operations with conflict resolution and recovery via reflog.

5|1|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/latestaiagents/agent-skills --skill rebase-safely
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rebase-safely
Source: https://github.com/latestaiagents/agent-skills/tree/main/plugins/developer-toolkit/skills/git/rebase-safely
Command: npx skills add https://github.com/latestaiagents/agent-skills --skill rebase-safely

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps users safely and effectively perform Git rebasing operations, preventing data loss and minimizing the risk of introducing conflicts or breaking the project history.

Core Features & Use Cases

  • Safe Rebasing: Provides clear guidelines on when rebase is safe and when it's not, emphasizing the "NEVER rebase pushed commits" rule.
  • Interactive Rebase: Guides users through cleaning up commit history, squashing, reordering, editing, and splitting commits.
  • Conflict Resolution: Offers strategies and commands for resolving conflicts that arise during a rebase.
  • Recovery: Includes methods to recover from a bad rebase using git reflog or ORIG_HEAD.
  • Rebase vs. Merge: Explains the differences and appropriate use cases for each.

Quick Start

Use the rebase-safely skill to update your feature branch with the latest changes from main.

Frequently Asked Questions about rebase-safely

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

FAQPage Schema
When should I use a Git rebase instead of a merge?

An interactive Git rebase allows you to clean up commit history by squashing, reordering, editing, or splitting commits before integrating them. It helps maintain a concise and meaningful project history for your feature branch.

How do I resolve conflicts during a Git rebase?

To resolve conflicts during a Git rebase, you manually edit the conflicting files, stage the changes, and continue the rebase process. This ensures your feature branch integrates cleanly with the target branch without losing work.

How do I recover lost commits if a Git rebase goes wrong?

Recover lost commits after a bad Git rebase by using the git reflog command or ORIG_HEAD reference. These mechanisms allow you to locate previous HEAD states and reset your branch back to its original state before the rebase.

Is it safe to rebase commits that have already been pushed to a remote repository?

Before using Git rebase, fetch the latest changes from the remote repository to update your local main branch. This provides the updated base commits needed to safely apply your local feature branch changes without conflicts.

Can I update my feature branch with the latest changes without merging?

You can update a feature branch with the latest changes by fetching remote updates and running a Git rebase. This replays your local commits on top of the newest main branch code to keep your history linear.