rebase-safely

Guide safe Git rebases with backup and conflict resolution steps.

746|130|Updated Jun 30, 2026
One-click install
npx skills add https://github.com/Archive228/loopkit --skill rebase-safely-archive228
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rebase-safely
Source: https://github.com/Archive228/loopkit/tree/main/skills/rebase-safely
Command: npx skills add https://github.com/Archive228/loopkit --skill rebase-safely-archive228

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides a set of guidelines and commands to safely rebase, squash, or rewrite Git history without the risk of losing work or breaking shared branches.

Core Features & Use Cases

  • Backup First: Ensures a safe rollback point before any history rewrite.
  • Rebase with Safety: Offers steps to rebase onto the latest base branch.
  • Conflict Resolution: Provides instructions for resolving conflicts one commit at a time.
  • Shared History Integrity: Emphasizes not to rewrite shared history to avoid pain for others.
  • Force Push with Lease: Suggests using --force-with-lease for pushing to avoid data loss.

Quick Start

Use the rebase-safely skill to safely rebase your branch onto the main branch with ./run.sh rebase-safely main.

Frequently Asked Questions about rebase-safely

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

FAQPage Schema
How do I safely rebase a git branch without losing commits?

To safely rebase a git branch, create a backup branch first to establish a rollback point, then rebase onto the target base branch and resolve conflicts one commit at a time to prevent history loss.

What is the safest way to rewrite shared git history?

The safest approach to shared git history is to avoid rewriting it entirely. If you must rewrite history, use force push with lease to avoid overwriting others' work and causing branch conflicts.

How do I resolve git rebase conflicts step by step?

To resolve git rebase conflicts, address each conflict one commit at a time. The process emphasizes resolving issues sequentially during the rebase operation to maintain history integrity and prevent data loss.

Why should I use force push with lease when rebasing?

Using force push with lease when rebasing prevents data loss by checking that your remote branch matches the expected state before overwriting. It stops you from accidentally erasing changes pushed by others.

Can I rebase a branch that has already been pushed to a shared remote?

Rebasing a branch already pushed to a shared remote is discouraged due to shared history integrity. If absolutely necessary, you must use force push with lease and ensure teammates are aware to avoid causing pain.