rebase

Rebase the current Git branch onto a base branch, resolve conflicts, and force-push.

3|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/ronaknnathani/relay --skill rebase-ronaknnathani
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rebase
Source: https://github.com/ronaknnathani/relay/tree/main/skills/rebase
Command: npx skills add https://github.com/ronaknnathani/relay --skill rebase-ronaknnathani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Rebasing a feature branch onto an updated main branch often involves repetitive Git commands, manual conflict resolution, and risky force-pushes. This Skill automates the full rebase workflow while protecting uncommitted work and using safe push semantics. ## Core Features & Use Cases - Guided Rebase Workflow: Fetches the latest base branch, rebases the current branch, and verifies the result with a commit log check. - Conflict Resolution Loop: Lists conflicted files, resolves merge conflicts round by round (up to 10 rounds), and continues the rebase until clean. - Safe Push Handling: Detects whether the branch has an upstream, pushes with -u on first push, and uses --force-with-lease instead of --force to avoid overwriting others' work. - Use Case: Your pull request shows merge conflicts after main moved forward. Invoke this Skill to rebase onto origin/main, resolve the conflicts, and force-push so the open PR updates automatically. ## Quick Start Ask the agent to rebase the current branch onto main, resolve any conflicts, and push the result safely.

Frequently Asked Questions about rebase

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

FAQPage Schema
How do I rebase my branch onto main and resolve conflicts?▼

Fetch the latest main branch, run git rebase origin/main, then resolve each conflicted file listed by git diff --name-only --diff-filter=U. Stage resolved files and run git rebase --continue until the rebase completes, then push with force-with-lease.

How to force-push safely after a Git rebase?▼

Use git push --force-with-lease instead of --force. It fails safely if someone else pushed to the branch in the meantime, preventing accidental overwrites of teammates' commits while still updating your rebased branch.

Can I rebase with uncommitted changes in my working tree?▼

No, this Skill aborts if git status --porcelain shows uncommitted changes and asks you to commit or stash first. It deliberately does not auto-stash because automatic stashing makes it too easy to lose work.

What happens if rebase conflicts keep appearing?▼

The Skill resolves conflicts iteratively, staging files and continuing the rebase each round. After 10 conflict rounds without resolution, it aborts and asks the user rather than looping indefinitely.

Does force-pushing after rebase update an open pull request?▼

Yes, if the branch already has an open pull request, the force-push updates it automatically with the rebased commits. No separate pull request action is needed after the push completes.